Skip to content
Snippets Groups Projects
Commit be2f138c authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix corrupted HTML if leading whitespace

This fixes an issue where text scrubbed with the new balancing system would
receive a leading ' <div>' if the text started with a leading whitespace.
parent a7d44f82
Branches
Tags
No related merge requests found
...@@ -164,7 +164,7 @@ class Format { ...@@ -164,7 +164,7 @@ class Format {
$html = $doc->saveHTML(); $html = $doc->saveHTML();
$html = preg_replace('`^<!DOCTYPE.+?>|<\?xml .+?>|</?html>|</?body>|</?head>|<meta .+?/?>`', '', $html); # <?php $html = preg_replace('`^<!DOCTYPE.+?>|<\?xml .+?>|</?html>|</?body>|</?head>|<meta .+?/?>`', '', $html); # <?php
} }
return preg_replace('`^<div>|</div>$`', '', $html); return preg_replace('`^<div>|</div>$`', '', trim($html));
} }
function html($html, $config=array()) { function html($html, $config=array()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment