Ticket #6913: 6913.patch

File 6913.patch, 1.8 KB (added by Wiktor Walc, 13 years ago)
  • ckeditor_php4.php

     
    566566                                // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
    567567                                // we should get the same result in the JS frontend (string).
    568568                                // Character replacements for JSON.
    569                                 static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
    570                                 array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
     569                                static $jsonReplaces;
     570                                if (!isset($jsonReplaces)) {
     571                                        $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", chr(8), "\f", '"'),
     572                                        array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
     573                                }
    571574
    572575                                $val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
    573576                                if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
  • ckeditor_php5.php

     
    556556                                // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
    557557                                // we should get the same result in the JS frontend (string).
    558558                                // Character replacements for JSON.
    559                                 static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
    560                                 array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
     559                                static $jsonReplaces;
     560                                if (!isset($jsonReplaces)) {
     561                                        $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", chr(8), "\f", '"'),
     562                                        array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
     563                                }
    561564
    562565                                $val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
    563566                                if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy