Ticket #15588: googlespell.preg-eval-remove.diff

File googlespell.preg-eval-remove.diff, 1005 bytes (added by underground-stockholm, 2 years ago)
Line 
1--- wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php.old     2008-08-20 08:20:22.000000000 +0200
2+++ wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php 2010-11-27 00:15:54.000000000 +0100
3@@ -105,9 +105,17 @@
4                return $matches;
5        }
6 
7+       function _unhtmlentities_cb1($matches) {
8+               return chr(hexdec($matches[1]));
9+       }
10+
11+       function _unhtmlentities_cb2($matches) {
12+               return chr($matches[1]);
13+       }
14+
15        function _unhtmlentities($string) {
16-               $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
17-               $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
18+               $string = preg_replace_callback('~&#x([0-9a-f]+);~i', array(get_class($this), '_unhtmlentities_cb1'), $string);
19+               $string = preg_replace_callback('~&#([0-9]+);~', array(get_class($this), '_unhtmlentities_cb2'), $string);
20 
21                $trans_tbl = get_html_translation_table(HTML_ENTITIES);
22                $trans_tbl = array_flip($trans_tbl);
23@@ -156,4 +164,4 @@
24        }
25 }
26 
27-?>
28\ No newline at end of file
29+?>