Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SmiLeYre committed Mar 2, 2024
2 parents bddd4d7 + 3e75923 commit 9a48a9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/datums/elements/flavor_text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
return

// Validate the headshot URL
var/static/link_regex = regex("https://i\\.gyazo\\.com|https://media\\.discordapp\\.net|https://cdn\\.discordapp\\.com|https://media\\.discordapp\\.net$")
var/static/link_regex = regex("https://i\\.gyazo\\.com|https://media\\.discordapp\\.net|https://cdn\\.discordapp\\.com|https://media\\.discordapp\\.net$|https://static1\\.e621\\.net")
var/static/end_regex = regex("\\.jpg|\\.png|\\.jpeg$")

if(!findtext(new_headshot, link_regex))
to_chat(src, span_warning("The link needs to be an unshortened Gyazo or Discordapp link!"))
to_chat(src, span_warning("The link needs to be an unshortened Gyazo, E621, or Discordapp link!"))
return
if(!findtext(new_headshot, end_regex))
to_chat(src, span_warning("You need either \".png\", \".jpg\", or \".jpeg\" in the link!"))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4164,11 +4164,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
features["headshot_link"] = null
return

var/static/link_regex = regex("https://i.gyazo.com|https://media.discordapp.net|https://cdn.discordapp.com|https://media.discordapp.net$") //Do not touch the damn duplicates.
var/static/link_regex = regex("https://i.gyazo.com|https://media.discordapp.net|https://cdn.discordapp.com|https://media.discordapp.net$|https://static1.e621.net") //Do not touch the damn duplicates.
var/static/end_regex = regex(".jpg|.jpg|.png|.jpeg|.jpeg") //Regex is terrible, don't touch the duplicate extensions

if(!findtext(usr_input, link_regex, 1, 29))
to_chat(usr, span_warning("The link needs to be an unshortened Gyazo or Discordapp link!"))
to_chat(usr, span_warning("The link needs to be an unshortened Gyazo, E621, or Discordapp link!"))
return
if(!findtext(usr_input, end_regex))
to_chat(usr, span_warning("You need either \".png\", \".jpg\", or \".jpeg\" in the link!"))
Expand Down
3 changes: 3 additions & 0 deletions html/changelogs/archive/2024-03.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2024-03-02:
xhianil:
- rscadd: Use of E621 for headshots, because literally why not?

0 comments on commit 9a48a9d

Please sign in to comment.