X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=ckeditor_php4.php;h=784f293e30f161cc341678d2e7703f2236907273;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=699d7e59b6aa9b8378a83d38e6e54a1bcf6df348;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/ckeditor_php4.php b/ckeditor_php4.php index 699d7e5..784f293 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) . '"'; } }