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 {
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user