1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 02:34:24 +02:00

Fix issue processwire/processwire-issues#92 where $sanitizer->markupToText() left useless trailing character when replacing br tags

This commit is contained in:
Ryan Cramer
2016-11-23 06:43:14 -05:00
parent c1f4693ca0
commit 2a66b67174

View File

@@ -1070,9 +1070,10 @@ class Sanitizer extends Wire {
if(strpos($value, '<') !== false) {
// tag replacements before strip_tags()
$regex =
'!(?:<' .
'/?(?:ul|ol|p|h\d|div)(?:>|\s[^><]*)' .
'|br[\s/]*' .
'!<(?:' .
'/?(?:ul|ol|p|h\d|div)(?:>|\s[^><]*)' .
'|' .
'(?:br[\s/]*)' .
')>!is';
$value = preg_replace($regex, $newline, $value);
if(stripos($value, '</li>')) {