X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=ckeditor_php4.php;h=841748461b9be786c27f2370a1b78b4ca0b18771;hb=1056598c95187351dc58f4991d331e2258d038b5;hp=32b4f2fafadf9c22894aedfea848aa49937b8a7b;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/ckeditor_php4.php b/ckeditor_php4.php index 32b4f2f..8417484 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) . '"'; } }