Fix preg_replace_callback() error in Html2Text - closes #5433
This commit is contained in:
@@ -2454,6 +2454,9 @@ class Helper
|
||||
if ((int)ini_get('pcre.backtrack_limit') <= 1000000) {
|
||||
ini_set('pcre.backtrack_limit', 1000000000);
|
||||
}
|
||||
if ((int)ini_get('pcre.recursion_limit') <= 1000000) {
|
||||
ini_set('pcre.recursion_limit', 1000000000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -366,7 +366,12 @@ class Html2Text
|
||||
{
|
||||
$this->convertBlockquotes($text);
|
||||
$this->convertPre($text);
|
||||
$text_copy = $text;
|
||||
$text = preg_replace($this->search, $this->replace, $text);
|
||||
if ($text === null) {
|
||||
$text = $text_copy;
|
||||
$text_copy = null;
|
||||
}
|
||||
$text = preg_replace_callback($this->callbackSearch, array($this, 'pregCallback'), $text);
|
||||
$text = $text ?? '';
|
||||
$text = strip_tags($text);
|
||||
|
||||
Reference in New Issue
Block a user