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