forked from services/mlmmj-light-web-ecg
Added more descriptive error messages for three cases.
This commit is contained in:
@@ -32,16 +32,16 @@ if ( !isset($_SESSION["auth"]) || $_SESSION["auth"] != 1 )
|
||||
|
||||
$domain = $_SESSION["domain"];
|
||||
|
||||
// We do not print any error in the next four cases, because a legitimate
|
||||
// user will never produce such results, even with disabled javascript
|
||||
if ( preg_match("/[^a-z0-9_-]/", $list_name) )
|
||||
{
|
||||
$_SESSION["error_code"] = 14;
|
||||
header("Location: error.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if ( strlen($list_name) > 50 )
|
||||
{
|
||||
$_SESSION["error_code"] = 13;
|
||||
header("Location: error.php");
|
||||
exit();
|
||||
}
|
||||
@@ -49,6 +49,7 @@ if ( strlen($list_name) > 50 )
|
||||
// Test list existence
|
||||
if( !is_dir("$lists_path/$domain/$list_name") || $list_name == "" )
|
||||
{
|
||||
$_SESSION["error_code"] = 12;
|
||||
header("Location: error.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user