- Patch #101775 by Steven: don't cut off posts at a lone <
parent
cc2cb795d5
commit
ae0407ab8b
|
@ -1253,9 +1253,11 @@ function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite',
|
|||
|
||||
return preg_replace_callback('%
|
||||
(
|
||||
<[^>]*.(>|$) # a string that starts with a <, up until the > or the end of the string
|
||||
| # or
|
||||
> # just a >
|
||||
<(?=[^a-zA-Z/]) # a lone <
|
||||
| # or
|
||||
<[^>]*.(>|$) # a string that starts with a <, up until the > or the end of the string
|
||||
| # or
|
||||
> # just a >
|
||||
)%x', '_filter_xss_split', $string);
|
||||
}
|
||||
|
||||
|
@ -1286,6 +1288,10 @@ function _filter_xss_split($m, $store = FALSE) {
|
|||
// We matched a lone ">" character
|
||||
return '>';
|
||||
}
|
||||
else if (strlen($string) == 1) {
|
||||
// We matched a lone "<" character
|
||||
return '<';
|
||||
}
|
||||
|
||||
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches)) {
|
||||
// Seriously malformed
|
||||
|
|
Loading…
Reference in New Issue