Skip to content

Commit

Permalink
Fix too strict check on validity of template name
Browse files Browse the repository at this point in the history
 - use preg_match instead of ctype_alnum, because _ is allowed as well
  • Loading branch information
torinfo committed Aug 19, 2024
1 parent cbba54b commit 02ce480
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website_code/php/templates/duplicate_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
$folder_id = x_clean_input($_POST['folder_id']);
$template_name = x_clean_input($_POST['template_name']);

if (!ctype_alnum($template_name))
if (!preg_match('/^[a-zA-Z0-9_]+$/',$template_name))
{
die("Invalid template name");
}
Expand Down

0 comments on commit 02ce480

Please sign in to comment.