Skip to content
Browse files

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

  • Loading branch information...
1 parent 15df124 commit 485c80f39a1d2c86dfd93b0d9ebedaa4c3504332 fmarier committed May 22, 2009
Showing with 16 additions and 1 deletion.
  1. +1 −1 lib/html2text.php
  2. +15 −0 lib/html2text_readme.txt
View
2 lib/html2text.php
@@ -468,7 +468,7 @@ function _convert()
// 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));
View
15 lib/html2text_readme.txt
@@ -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 <francois@catalyst.net.nz> 2009-05-22

0 comments on commit 485c80f

Please sign in to comment.
Something went wrong with that request. Please try again.