about summary refs log tree commit diff
path: root/sourcecodes
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes')
-rw-r--r--sourcecodes/input_validate.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/sourcecodes/input_validate.php b/sourcecodes/input_validate.php
index f5d5a4fc..06843a57 100644
--- a/sourcecodes/input_validate.php
+++ b/sourcecodes/input_validate.php
@@ -3,7 +3,7 @@
 
 function valid_keyval($keyval)
 {
-  $keyval = trim($keyval);
+  $keyval = trim((string)($keyval ?? ''));
   $keyval = stripslashes($keyval);
   $keyval = htmlspecialchars($keyval);
   //check if keyval contains only uppercase or lowercase letters.
@@ -19,7 +19,7 @@ function valid_keyval($keyval)
 
 function valid_input($input)
 {
-  $input = trim($input);
+  $input = trim((string)($input ?? ''));
   $input = stripslashes($input);
   $input = htmlspecialchars($input);
   //check if keyval contains only letters, numbers, hyphens, underscore, periods, or whitespace.