handle various functions no longer dealing with null

pull/3494/head
Isaac Connor 2022-06-01 13:01:40 -04:00
parent 553c79d8f9
commit 7c0dcfcefc
1 changed files with 3 additions and 0 deletions

View File

@ -1959,16 +1959,19 @@ function validNum( $input ) {
// For general strings
function validStr($input) {
if(!$input) return '';
return strip_tags($input);
}
// For strings in javascript or tags etc, expected to be in quotes so further quotes escaped rather than converted
function validJsStr($input) {
if(!$input) return '';
return strip_tags(addslashes($input));
}
// For general text in pages outside of tags or quotes so quotes converted to entities
function validHtmlStr($input) {
if(!$input) return '';
return htmlspecialchars($input, ENT_QUOTES);
}