Use strip tags in sanitize_text over deprecated FILTER_SANITIZE_STRING
This commit is contained in:
parent
2a333c1de6
commit
321609306d
|
@ -73,13 +73,12 @@ final class MD_STD_IN {
|
|||
*/
|
||||
public static function sanitize_text(mixed $input):string {
|
||||
|
||||
$output = \filter_var($input,
|
||||
FILTER_SANITIZE_STRING,
|
||||
FILTER_FLAG_NO_ENCODE_QUOTES);
|
||||
$output = \filter_var($input, FILTER_UNSAFE_RAW);
|
||||
|
||||
if ($output === false) {
|
||||
return "";
|
||||
}
|
||||
$output = strip_tags($output);
|
||||
while (strpos($output, " ") !== false) {
|
||||
$output = str_replace(" ", " ", $output);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user