Make error messages for disallowed values more explicit
This commit is contained in:
parent
43bc39d425
commit
2f68acdfc1
@ -107,7 +107,7 @@ final class MD_STD_IN {
|
||||
else $output = self::sanitize_text($default);
|
||||
|
||||
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;
|
||||
@ -132,7 +132,7 @@ final class MD_STD_IN {
|
||||
else $output = self::sanitize_text($default);
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user