MDL-19266 lib/html2text: fix error in preg_replace_callback on php4

This commit is contained in:
fmarier
2009-05-22 02:21:34 +00:00
parent b60e4cc9a3
commit cf9faae277
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -468,7 +468,7 @@ class html2text
// Run our defined search-and-replace
$text = preg_replace($this->search, $this->replace, $text);
$text = preg_replace_callback($this->callback_search, array('html2text', '_preg_callback'), $text);
$text = preg_replace_callback($this->callback_search, array(&$this, '_preg_callback'), $text);
// Replace known html entities
$text = utf8_encode(html_entity_decode($text));
+15
View File
@@ -21,4 +21,19 @@ instead of:
(see http://nz.php.net/manual/en/function.html-entity-decode.php#89483)
2- fixed error in preg_replace_callback on php4
--- a/lib/html2text.php
+++ b/lib/html2text.php
@@ -468,7 +468,7 @@ class html2text
// Run our defined search-and-replace
$text = preg_replace($this->search, $this->replace, $text);
- $text = preg_replace_callback($this->callback_search, array('html2text', '_preg_callback'), $text);
+ $text = preg_replace_callback($this->callback_search, array(&$this, '_preg_callback'), $text);
// Replace known html entities
$text = utf8_encode(html_entity_decode($text));
-- Francois Marier <[email protected]> 2009-05-22