X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=ckeditor_php5.php;h=25563536db1163acc04b68bdbc61b3af71f328fb;hb=f0610347140239143439a511ee2bd48cb784f470;hp=ab1612d8f38cb05b846b51deb6e82bb8353d8e1b;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/ckeditor_php5.php b/ckeditor_php5.php index ab1612d..2556353 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) . '"'; } }