Skip to content

Commit

Permalink
sanitize inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jnackmclain committed Sep 20, 2023
1 parent 94258d4 commit a276ddc
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _ark/dx/overshell/dx_track_theme_states.dta
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}
{if {== {elem $entry 0} {basename track_theme_name}}
{set $dx_track_theme_name $text}
{dx_special_char_sanitize}
{foreach $entry $dx_tracked_track_themes
{if {== $entry $text}
{set $dx_pushed TRUE}
Expand Down Expand Up @@ -99,6 +100,7 @@
$text
""}}}
{set $dx_track_theme_name $text}
{dx_special_char_sanitize}
{switch $dx_task
(load LOAD_DTA_DIRECTLY)
(save
Expand All @@ -107,6 +109,7 @@
{$this show_state dxState_ThemeOverwriteWarn}
{do
{set $dx_track_theme_name $text}
{dx_special_char_sanitize}
{foreach $entry $dx_tracked_track_themes
{if {== $entry $text}
{set $dx_pushed TRUE}
Expand Down
1 change: 1 addition & 0 deletions _ark/dx/ui/dx_funcs.dta
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include ../funcs/dx_game_funcs.dta
#include dx_camera_funcs.dta
#include dx_special_char_funcs.dta
#include dx_log_funcs.dta
#include ../track/dx_mtv_funcs.dta
#include ../track/dx_countdown_funcs.dta
Expand Down
100 changes: 100 additions & 0 deletions _ark/dx/ui/dx_special_char_funcs.dta
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{func
dx_special_char_sanitize
{tolower $dx_track_theme_name}
{search_replace $dx_track_theme_name " " "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "#" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "!" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "\q" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "$" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "%" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "&" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "'" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "(" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name ")" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "*" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "+" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "," "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "-" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "." "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "/" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name ":" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name ";" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "=" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "?" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "@" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "[" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "\\" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "]" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "^" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "`" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "{" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "|" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "}" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "~" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "°" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "©" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "®" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "¡" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "¿" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "À" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Á" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Â" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ã" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ä" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Å" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Æ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ç" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Î" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "É" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ê" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ë" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ì" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Í" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ï" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ð" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ñ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ò" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ó" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ô" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Õ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ö" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ø" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ù" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ú" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Û" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ü" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Ý" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "Þ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ß" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "à" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "á" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "â" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ã" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ä" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "å" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "æ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ç" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "è" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "é" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ê" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ë" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ì" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "í" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "î" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ï" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ð" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ñ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ò" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ó" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ô" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "õ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ö" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ø" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ù" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ú" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "û" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ü" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ý" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "þ" "_" $dx_track_theme_name}
{search_replace $dx_track_theme_name "ÿ" "_" $dx_track_theme_name}
}

0 comments on commit a276ddc

Please sign in to comment.