Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deploy/lib/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ public static function toInt($dirty)
public static function filter_string_polyfill(string $string): string
{
$str = preg_replace('/\x00|<[^>]*>?/', '', $string);
return str_replace(["'", '"'], ['', ''], $str);
return str_replace(["'", '"'], ['&#39;', '&#34;'], $str);
}

/**
* Strip low and high ascii characters, leave standard keyboard characters
*/
public static function toSimple($dirty)
{
return filter_var(
str_replace(['"', '\''], '', Filter::filter_string_polyfill($dirty)),
FILTER_UNSAFE_RAW,
return static::filter_string_polyfill(filter_var(
str_replace(['"', '\''], '', $dirty),
FILTER_SANITIZE_FULL_SPECIAL_CHARS,
FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH
);
));
}
}
Loading