Skip to content
Snippets Groups Projects
Commit 1d027303 authored by Till's avatar Till
Browse files

Fixes #6596 improve language file editor input validation

parent 7c9b2065
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ if(isset($_POST['records']) && is_array($_POST['records'])) { ...@@ -64,6 +64,7 @@ if(isset($_POST['records']) && is_array($_POST['records'])) {
$val = stripslashes($val); $val = stripslashes($val);
$val = preg_replace('/(^|[^\\\\])((\\\\\\\\)*)"/', '$1$2\\"', $val); $val = preg_replace('/(^|[^\\\\])((\\\\\\\\)*)"/', '$1$2\\"', $val);
$val = str_replace('$', '', $val); $val = str_replace('$', '', $val);
if(!preg_match("/^[a-z0-9_]+$/", $key)) die('Invalid language file key.');
$file_content .= '$wb['."'$key'".'] = "'.$val.'";'."\n"; $file_content .= '$wb['."'$key'".'] = "'.$val.'";'."\n";
$msg = 'File saved.'; $msg = 'File saved.';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment