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:
@@ -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>')) {
|
||||
|
Reference in New Issue
Block a user