修改一处逻辑错误

This commit is contained in:
麦当苗儿
2013-04-19 16:13:05 +08:00
parent 6c94b221d8
commit 93cd95640b

View File

@@ -40,8 +40,11 @@ class Transform {
// Transform::jsonDecode('abc', true);
static public function __callStatic($method, $params){
$type = substr($method, 0, strlen($method) - 6);
$method = substr($method, -6);
$method = strtolower(substr($method, -6));
$assoc = empty($params[2]) ? true : false;
if(!in_array($method, ['encode', 'decode'])){
throw new Think\Exception("call to undefined method {$method}");
}
return self::$method($params[0], $type, $assoc);
}
}