mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-03 23:04:04 +01:00
(Fixes issue 1093) CJSON now tries to use native PHP functions prior to use Yii implementation (Sam Dark)
This commit is contained in:
@@ -104,12 +104,7 @@ class CJavaScript
|
||||
*/
|
||||
public static function jsonEncode($data)
|
||||
{
|
||||
if(function_exists('json_encode'))
|
||||
return json_encode($data);
|
||||
else
|
||||
{
|
||||
return CJSON::encode($data);
|
||||
}
|
||||
return CJSON::encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,9 +115,6 @@ class CJavaScript
|
||||
*/
|
||||
public static function jsonDecode($data,$useArray=true)
|
||||
{
|
||||
if(function_exists('json_decode'))
|
||||
return json_decode($data,$useArray);
|
||||
else
|
||||
return CJSON::decode($data,$useArray);
|
||||
return CJSON::decode($data,$useArray);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user