X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=ckeditor_php4.php;h=14ea95485fdb9ad7742d81e0cdcf6d2eefd3b902;hb=e73319a12b56100b29ef456fd74114fe5519e01c;hp=b4b41d657ad818317248e6cf48eda4593b161c9a;hpb=9afde8772159bd3436f1f5b7862960307710ae5a;p=ckeditor.git diff --git a/ckeditor_php4.php b/ckeditor_php4.php index b4b41d6..14ea954 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) . '"'; } }