Use strip tags in sanitize_text over deprecated FILTER_SANITIZE_STRING

This commit is contained in:
Joshua Ramon Enslin 2022-02-02 02:18:33 +01:00
parent 2a333c1de6
commit 321609306d
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -73,13 +73,12 @@ final class MD_STD_IN {
*/ */
public static function sanitize_text(mixed $input):string { public static function sanitize_text(mixed $input):string {
$output = \filter_var($input, $output = \filter_var($input, FILTER_UNSAFE_RAW);
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES);
if ($output === false) { if ($output === false) {
return ""; return "";
} }
$output = strip_tags($output);
while (strpos($output, " ") !== false) { while (strpos($output, " ") !== false) {
$output = str_replace(" ", " ", $output); $output = str_replace(" ", " ", $output);
} }