From 2f68acdfc1c098229232c1348877dd13a99e7723 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sat, 24 Oct 2020 12:46:18 +0200 Subject: [PATCH] Make error messages for disallowed values more explicit --- MD_STD_IN.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MD_STD_IN.php b/MD_STD_IN.php index b3dc315..e1a82c5 100644 --- a/MD_STD_IN.php +++ b/MD_STD_IN.php @@ -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;