Make error messages for disallowed values more explicit
This commit is contained in:
@@ -107,7 +107,7 @@ final class MD_STD_IN {
|
|||||||
else $output = self::sanitize_text($default);
|
else $output = self::sanitize_text($default);
|
||||||
|
|
||||||
if (!empty($allowed) and !\in_array($output, $allowed, true)) {
|
if (!empty($allowed) and !\in_array($output, $allowed, true)) {
|
||||||
Throw new MDpageParameterNotFromListException("Parameter `{$var_name}` must be any of the allowed values: " . implode(', ', $allowed));
|
Throw new MDpageParameterNotFromListException("Parameter `{$var_name}` must be any of the allowed values: '" . implode('\', \'', $allowed) . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
@@ -132,7 +132,7 @@ final class MD_STD_IN {
|
|||||||
else $output = self::sanitize_text($default);
|
else $output = self::sanitize_text($default);
|
||||||
|
|
||||||
if (!empty($allowed) and !\in_array($output, $allowed, true)) {
|
if (!empty($allowed) and !\in_array($output, $allowed, true)) {
|
||||||
Throw new MDpageParameterNotFromListException("Parameter `{$var_name}` must be any of the allowed values: " . implode(', ', $allowed));
|
Throw new MDpageParameterNotFromListException("Parameter `{$var_name}` must be any of the allowed values: '" . implode('\', \'', $allowed) . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
|
Reference in New Issue
Block a user