X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=ckeditor_php5.php;h=f5840a4db755970a7a4ddf39c2d5d7829fe1a96a;hp=af11a5a1adfb3797743368771bfbc29ed8906dba;hb=4e90e78dc97789709ee7404359a5517540c27553;hpb=f8fc585c18d287eb325c575596d183122486b641 diff --git a/ckeditor_php5.php b/ckeditor_php5.php index af11a5a..f5840a4 100644 --- a/ckeditor_php5.php +++ b/ckeditor_php5.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) . '"'; } }