X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=ckeditor_php4.php;h=7fc9babe02132f4a666f488418e9573836e84b05;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=bfe7c63cbb25cb677b1802c2f770484915e0dcb1;hpb=f8fc585c18d287eb325c575596d183122486b641;p=ckeditor.git diff --git a/ckeditor_php4.php b/ckeditor_php4.php index bfe7c63..7fc9bab 100644 --- a/ckeditor_php4.php +++ b/ckeditor_php4.php @@ -1,6 +1,6 @@ $v){ + $temp[] = $this->jsEncode("{$k}") . ':' . $this->jsEncode($v); + } + return '{' . implode(',', $temp) . '}'; } - $result = array(); - if ($isList) - { - foreach ($val as $v) $result[] = $this->jsEncode($v); - return '[ ' . join(', ', $result) . ' ]'; - } - else - { - foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); - return '{ ' . join(', ', $result) . ' }'; - } + // String otherwise + if (strpos($val, '@@') === 0) + return substr($val, 2); + if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') + return $val; + + return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"'; } }