Skip to content

Commit

Permalink
Adding missing sanitization on embed strings to prevent possible errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaFox161 committed Sep 6, 2024
1 parent 1a80b72 commit c7f9222
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class EmbedService(
val computedDescription = settings.staticMessageDescription ?: localeService.getString(settings.locale, "embed.static.desc")

val builder = defaultEmbedBuilder(settings)
.title(computedTitle)
.description(computedDescription)
.title(computedTitle.embedTitleSafe())
.description(computedDescription.embedDescriptionSafe())
.footer(localeService.getString(settings.locale, "embed.static.footer"), null)
.timestamp(Instant.now())

Expand Down Expand Up @@ -140,7 +140,7 @@ class EmbedService(
suspend fun getTicketOpenEmbed(creator: Member, project: Project?, info: String?): EmbedCreateSpec {
val embedBuilder = EmbedCreateSpec.builder()
.author("@${creator.displayName}", null, creator.avatarUrl)
if (!project?.name.isNullOrBlank()) embedBuilder.title(project!!.name)
if (!project?.name.isNullOrBlank()) embedBuilder.title(project!!.name.embedTitleSafe())
if (!info.isNullOrBlank()) embedBuilder.description(info.embedDescriptionSafe())

return embedBuilder.build()
Expand Down

0 comments on commit c7f9222

Please sign in to comment.