mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-06-16 17:54:31 +02:00
Fixed illegal string filter on name change
Fixed illegal string filter on name change
This commit is contained in:
parent
fb52ef0c4f
commit
9db05fe4c1
@ -97,6 +97,17 @@ if (!empty($_POST['change_name'])) {
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
// Check name for illegal characters.
|
||||
function checkNewNameForIllegal($name) {
|
||||
if (preg_match('#^[\0-9åäö&()+%/*$€é,.\'"-]*$#i', $name)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (checkNewNameForIllegal($newname)) {
|
||||
$error = true;
|
||||
echo 'This name contains illegal characters.';
|
||||
}
|
||||
if ($error === false) {
|
||||
// Change the name!
|
||||
mysql_update("UPDATE `players` SET `name`='$newname' WHERE `id`='".$player['id']."' LIMIT 1;");
|
||||
|
Loading…
x
Reference in New Issue
Block a user