osclass/OSClass — Issue #154: preg_match error in Lexer.php
Author: morvy
Created: 2012-02-21 21:48:44+00:00
State: open

Warning: preg_match() expects parameter 2 to be string, array given in /site/oc-includes/htmlpurifier/HTMLPurifier/Lexer.php on line 316

I've modified function to code shown below, don't know if it works, I don't even know what is this function used for, but maybe this could be solution? :)

public function extractBody($html) {
$matches = array();
for($i = 0; $i < count($html); $i++) {
$result = preg_match('!]*>(.*)

!is', $html[$i], $matches);
if($result == 1) {
break;
}
}
if($result) {
return $matches[1];
} else {
return $html;
}
}