From d2bc0d2bc6d5afd95bca6fe4929b283be45f1351 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:15:30 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B2=A1=E7=94=A8?= =?UTF-8?q?=E5=88=B0=E7=9A=84=E5=B1=80=E9=83=A8=E5=8F=98=E9=87=8F$k?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Action/RestAction.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extend/Action/RestAction.class.php b/Extend/Action/RestAction.class.php index bd130c0..94f8dce 100644 --- a/Extend/Action/RestAction.class.php +++ b/Extend/Action/RestAction.class.php @@ -312,7 +312,7 @@ protected function getAcceptType(){ foreach($type as $key=>$val){ $array = explode(',',$val); - foreach($array as $k=>$v){ + foreach($array as $v){ if(stristr($_SERVER['HTTP_ACCEPT'], $v)) { return $key; } From 97826b9a826b53a3b0e3aec622d74c5a0f343e26 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:17:06 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9encodeData=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E6=B3=A8=E9=87=8A=EF=BC=8C=E4=BB=8E@return?= =?UTF-8?q?=20void=20=E6=94=B9=E4=B8=BA=20@return=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Action/RestAction.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extend/Action/RestAction.class.php b/Extend/Action/RestAction.class.php index 94f8dce..46f2ea0 100644 --- a/Extend/Action/RestAction.class.php +++ b/Extend/Action/RestAction.class.php @@ -213,7 +213,7 @@ protected function response($data,$type='',$code=200) { * @access protected * @param mixed $data 要返回的数据 * @param String $type 返回类型 JSON XML - * @return void + * @return string */ protected function encodeData($data,$type='') { if(empty($data)) return ''; From 1366744dead0e44e4a5c466df2dd79aea9ca820b Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:25:52 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E9=AD=94=E6=9C=AF=E6=96=B9=E6=B3=95=5F?= =?UTF-8?q?=5Fcall=E7=9A=84=E5=8A=A8=E6=80=81=E8=B0=83=E7=94=A8=E5=87=BD?= =?UTF-8?q?=E6=95=B0:$fun($data)=20=E6=9B=B4=E6=94=B9=E4=B8=BA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8ReflectionFunction=E5=8F=8D=E5=B0=84=E7=B1=BB=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Action/RestAction.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Extend/Action/RestAction.class.php b/Extend/Action/RestAction.class.php index 46f2ea0..741ff33 100644 --- a/Extend/Action/RestAction.class.php +++ b/Extend/Action/RestAction.class.php @@ -139,9 +139,11 @@ public function __call($method,$args) { throw_exception(__CLASS__.':'.$method.L('_METHOD_NOT_EXIST_')); } if(isset($input[$args[0]])) { // 取值操作 - $data = $input[$args[0]]; - $fun = $args[1]?$args[1]:C('DEFAULT_FILTER'); - $data = $fun($data); // 参数过滤 + $data = $input[$args[0]]; + $fun = $args[1]?$args[1]:C('DEFAULT_FILTER'); + $ref_func = new ReflectionFunction($fun); + $data = $ref_func->invoke($data); // 参数过滤 + //$data = $fun($data); }else{ // 变量默认值 $data = isset($args[2])?$args[2]:NULL; } From a9d1796f231a0c887515d0114ac3b20120cc0652 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:26:38 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E9=97=AD=E5=90=88?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Behavior/AgentCheckBehavior.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Extend/Behavior/AgentCheckBehavior.class.php b/Extend/Behavior/AgentCheckBehavior.class.php index 59f374c..7e61524 100644 --- a/Extend/Behavior/AgentCheckBehavior.class.php +++ b/Extend/Behavior/AgentCheckBehavior.class.php @@ -28,5 +28,4 @@ public function run(&$params) { exit('Access Denied'); } } -} -?> \ No newline at end of file +} \ No newline at end of file From 23e1ae38fa9017cd99dac8171fcb5741abf83ca2 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:35:21 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E8=BD=BB=E5=BE=AE=E7=9A=84=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E9=94=99=E8=AF=AF:=20$this->handler=20=20=20=20=20=20?= =?UTF-8?q?=3D=20=20=20new=20Memcache;=20=E6=9B=B4=E6=94=B9=E4=B8=BA=20$th?= =?UTF-8?q?is->handler=20=20=20=20=20=20=3D=20=20=20new=20Memcache();=20?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9@return=20boolean=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20@return=20bool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Driver/Cache/CacheApachenote.class.php | 4 ++-- Extend/Driver/Cache/CacheApc.class.php | 6 +++--- Extend/Driver/Cache/CacheDb.class.php | 6 +++--- Extend/Driver/Cache/CacheEaccelerator.class.php | 4 ++-- Extend/Driver/Cache/CacheMemcache.class.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Extend/Driver/Cache/CacheApachenote.class.php b/Extend/Driver/Cache/CacheApachenote.class.php index dc930de..e0fdfe9 100644 --- a/Extend/Driver/Cache/CacheApachenote.class.php +++ b/Extend/Driver/Cache/CacheApachenote.class.php @@ -67,7 +67,7 @@ public function get($name) { * @access public * @param string $name 缓存变量名 * @param mixed $value 存储数据 - * @return boolen + * @return bool */ public function set($name, $value) { N('cache_write',1); @@ -93,7 +93,7 @@ public function set($name, $value) { * 删除缓存 * @access public * @param string $name 缓存变量名 - * @return boolen + * @return bool */ public function rm($name) { $this->open(); diff --git a/Extend/Driver/Cache/CacheApc.class.php b/Extend/Driver/Cache/CacheApc.class.php index 6538bae..d578e37 100644 --- a/Extend/Driver/Cache/CacheApc.class.php +++ b/Extend/Driver/Cache/CacheApc.class.php @@ -50,7 +50,7 @@ public function get($name) { * @param string $name 缓存变量名 * @param mixed $value 存储数据 * @param integer $expire 有效时间(秒) - * @return boolen + * @return bool */ public function set($name, $value, $expire = null) { N('cache_write',1); @@ -71,7 +71,7 @@ public function set($name, $value, $expire = null) { * 删除缓存 * @access public * @param string $name 缓存变量名 - * @return boolen + * @return bool */ public function rm($name) { return apc_delete($this->options['prefix'].$name); @@ -80,7 +80,7 @@ public function rm($name) { /** * 清除缓存 * @access public - * @return boolen + * @return bool */ public function clear() { return apc_clear_cache(); diff --git a/Extend/Driver/Cache/CacheDb.class.php b/Extend/Driver/Cache/CacheDb.class.php index f9b685b..233e56b 100644 --- a/Extend/Driver/Cache/CacheDb.class.php +++ b/Extend/Driver/Cache/CacheDb.class.php @@ -81,7 +81,7 @@ public function get($name) { * @param string $name 缓存变量名 * @param mixed $value 存储数据 * @param integer $expire 有效时间(秒) - * @return boolen + * @return bool */ public function set($name, $value,$expire=null) { $data = serialize($value); @@ -123,7 +123,7 @@ public function set($name, $value,$expire=null) { * 删除缓存 * @access public * @param string $name 缓存变量名 - * @return boolen + * @return bool */ public function rm($name) { $name = $this->options['prefix'].addslashes($name); @@ -133,7 +133,7 @@ public function rm($name) { /** * 清除缓存 * @access public - * @return boolen + * @return bool */ public function clear() { return $this->handler->execute('TRUNCATE TABLE `'.$this->options['table'].'`'); diff --git a/Extend/Driver/Cache/CacheEaccelerator.class.php b/Extend/Driver/Cache/CacheEaccelerator.class.php index 98a9db3..96a05c8 100644 --- a/Extend/Driver/Cache/CacheEaccelerator.class.php +++ b/Extend/Driver/Cache/CacheEaccelerator.class.php @@ -47,7 +47,7 @@ public function get($name) { * @param string $name 缓存变量名 * @param mixed $value 存储数据 * @param integer $expire 有效时间(秒) - * @return boolen + * @return bool */ public function set($name, $value, $expire = null) { N('cache_write',1); @@ -71,7 +71,7 @@ public function set($name, $value, $expire = null) { * 删除缓存 * @access public * @param string $name 缓存变量名 - * @return boolen + * @return bool */ public function rm($name) { return eaccelerator_rm($this->options['prefix'].$name); diff --git a/Extend/Driver/Cache/CacheMemcache.class.php b/Extend/Driver/Cache/CacheMemcache.class.php index 114d434..8c02994 100644 --- a/Extend/Driver/Cache/CacheMemcache.class.php +++ b/Extend/Driver/Cache/CacheMemcache.class.php @@ -41,7 +41,7 @@ function __construct($options=array()) { $this->options['prefix'] = isset($options['prefix'])? $options['prefix'] : C('DATA_CACHE_PREFIX'); $this->options['length'] = isset($options['length'])? $options['length'] : 0; $func = $options['persistent'] ? 'pconnect' : 'connect'; - $this->handler = new Memcache; + $this->handler = new Memcache(); $options['timeout'] === false ? $this->handler->$func($options['host'], $options['port']) : $this->handler->$func($options['host'], $options['port'], $options['timeout']); From 67e5abd082a251cd578e3190cf876ca3d55f78e9 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:42:31 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E8=BD=BB=E5=BE=AE=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E9=94=99=E8=AF=AF=20new=20Redis;=20=E6=94=B9=E4=B8=BA=20new=20?= =?UTF-8?q?Redis();?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Driver/Cache/CacheMemcache.class.php | 7 ++++--- Extend/Driver/Cache/CacheRedis.class.php | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Extend/Driver/Cache/CacheMemcache.class.php b/Extend/Driver/Cache/CacheMemcache.class.php index 8c02994..4543433 100644 --- a/Extend/Driver/Cache/CacheMemcache.class.php +++ b/Extend/Driver/Cache/CacheMemcache.class.php @@ -64,7 +64,7 @@ public function get($name) { * @param string $name 缓存变量名 * @param mixed $value 存储数据 * @param integer $expire 有效时间(秒) - * @return boolen + * @return bool */ public function set($name, $value, $expire = null) { N('cache_write',1); @@ -86,7 +86,8 @@ public function set($name, $value, $expire = null) { * 删除缓存 * @access public * @param string $name 缓存变量名 - * @return boolen + * @param bool $ttl 缓存生存期 单位:秒 + * @return bool */ public function rm($name, $ttl = false) { $name = $this->options['prefix'].$name; @@ -98,7 +99,7 @@ public function rm($name, $ttl = false) { /** * 清除缓存 * @access public - * @return boolen + * @return bool */ public function clear() { return $this->handler->flush(); diff --git a/Extend/Driver/Cache/CacheRedis.class.php b/Extend/Driver/Cache/CacheRedis.class.php index 1c7ff52..0a06d12 100644 --- a/Extend/Driver/Cache/CacheRedis.class.php +++ b/Extend/Driver/Cache/CacheRedis.class.php @@ -42,7 +42,7 @@ public function __construct($options=array()) { $this->options['prefix'] = isset($options['prefix'])? $options['prefix'] : C('DATA_CACHE_PREFIX'); $this->options['length'] = isset($options['length'])? $options['length'] : 0; $func = $options['persistent'] ? 'pconnect' : 'connect'; - $this->handler = new Redis; + $this->handler = new Redis(); $options['timeout'] === false ? $this->handler->$func($options['host'], $options['port']) : $this->handler->$func($options['host'], $options['port'], $options['timeout']); @@ -67,7 +67,7 @@ public function get($name) { * @param string $name 缓存变量名 * @param mixed $value 存储数据 * @param integer $expire 有效时间(秒) - * @return boolen + * @return bool */ public function set($name, $value, $expire = null) { N('cache_write',1); @@ -93,7 +93,7 @@ public function set($name, $value, $expire = null) { * 删除缓存 * @access public * @param string $name 缓存变量名 - * @return boolen + * @return bool */ public function rm($name) { return $this->handler->delete($this->options['prefix'].$name); From 7dc91653091a7063c17db5add7576f22b2531101 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:47:50 +0800 Subject: [PATCH 07/11] =?UTF-8?q?delete=E6=96=B9=E6=B3=95=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Driver/Cache/CacheRedis.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Extend/Driver/Cache/CacheRedis.class.php b/Extend/Driver/Cache/CacheRedis.class.php index 0a06d12..258d2ba 100644 --- a/Extend/Driver/Cache/CacheRedis.class.php +++ b/Extend/Driver/Cache/CacheRedis.class.php @@ -96,13 +96,15 @@ public function set($name, $value, $expire = null) { * @return bool */ public function rm($name) { - return $this->handler->delete($this->options['prefix'].$name); + //Redis::delete方法返回删除的数量,而不是布尔值 + $num = $this->handler->delete($this->options['prefix'].$name); + return $num > 0; } /** * 清除缓存 * @access public - * @return boolen + * @return bool */ public function clear() { return $this->handler->flushDB(); From c2566583374a370ac2cc826e358f8321bad96400 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 10:52:12 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E8=BD=BB=E5=BE=AE=E7=9A=84=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E9=94=99=E8=AF=AF=20new=20mongoClient();=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=20new=20MongoClient();?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Driver/Db/DbMongo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extend/Driver/Db/DbMongo.class.php b/Extend/Driver/Db/DbMongo.class.php index 4959b89..7b71142 100644 --- a/Extend/Driver/Db/DbMongo.class.php +++ b/Extend/Driver/Db/DbMongo.class.php @@ -52,7 +52,7 @@ public function connect($config='',$linkNum=0) { if(empty($config)) $config = $this->config; $host = 'mongodb://'.($config['username']?"{$config['username']}":'').($config['password']?":{$config['password']}@":'').$config['hostname'].($config['hostport']?":{$config['hostport']}":'').'/'.($config['database']?"{$config['database']}":''); try{ - $this->linkID[$linkNum] = new mongoClient( $host,$config['params']); + $this->linkID[$linkNum] = new MongoClient( $host,$config['params']); }catch (MongoConnectionException $e){ throw_exception($e->getmessage()); } From dfb9585ed4df4708006845314a98668639cb9b5e Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 11:04:44 +0800 Subject: [PATCH 09/11] =?UTF-8?q?is=5Futf8=E5=87=BD=E6=95=B0=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E4=BC=9A=E4=BC=98=E5=85=88=E4=BD=BF=E7=94=A8mb=5Fchec?= =?UTF-8?q?k=5Fencoding=E6=96=B9=E6=B3=95=20=E8=A1=A5=E5=85=85=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E5=87=BD=E6=95=B0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Function/extend.php | 44 ++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Extend/Function/extend.php b/Extend/Function/extend.php index a3320d5..e080c97 100644 --- a/Extend/Function/extend.php +++ b/Extend/Function/extend.php @@ -19,13 +19,11 @@ /** * 字符串截取,支持中文和其他编码 - * @static - * @access public * @param string $str 需要转换的字符串 - * @param string $start 开始位置 - * @param string $length 截取长度 + * @param int $start 开始位置 + * @param int $length 截取长度 * @param string $charset 编码格式 - * @param string $suffix 截断显示字符 + * @param bool $suffix 截断显示字符 * @return string */ function msubstr($str, $start=0, $length, $charset="utf-8", $suffix=true) { @@ -49,9 +47,8 @@ function msubstr($str, $start=0, $length, $charset="utf-8", $suffix=true) { /** * 产生随机字串,可用来自动生成密码 默认长度6位 字母和数字混合 - * @param string $len 长度 - * @param string $type 字串类型 - * 0 字母 1 数字 其它 混合 + * @param int $len 长度 + * @param string $type 字串类型:0 字母 1 数字 其它 混合 * @param string $addChars 额外字符 * @return string */ @@ -95,7 +92,8 @@ function rand_string($len=6,$type='',$addChars='') { /** * 获取登录验证码 默认为4位数字 - * @param string $fmode 文件名 + * @param int $length + * @param int $mode 字串类型:0 字母 1 数字 其它 混合 * @return string */ function build_verify ($length=4,$mode=1) { @@ -104,6 +102,8 @@ function build_verify ($length=4,$mode=1) { /** * 字节格式化 把字节数格式为 B K M G T 描述的大小 + * @param int $size + * @param int $dec * @return string */ function byte_format($size, $dec=2) { @@ -122,16 +122,22 @@ function byte_format($size, $dec=2) { * @return Boolean */ function is_utf8($string) { - return preg_match('%^(?: - [\x09\x0A\x0D\x20-\x7E] # ASCII - | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte - | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs - | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte - | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates - | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 - | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 - | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 - )*$%xs', $string); + if (function_exists('mb_check_encoding')) { + $flag = mb_check_encoding($string, 'UTF-8'); + } + else { + $flag = preg_match('%^(?: + [\x09\x0A\x0D\x20-\x7E] # ASCII + | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte + | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates + | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 + | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 + | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 + )*$%xs', $string); + } + return $flag; } /** * 代码加亮 From 1c7768ab69ac9d4ebe2ce0286cf0d1c52417f4a7 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 11:24:01 +0800 Subject: [PATCH 10/11] =?UTF-8?q?ezip=E5=87=BD=E6=95=B0bug=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Function/extend.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Extend/Function/extend.php b/Extend/Function/extend.php index e080c97..bbf7647 100644 --- a/Extend/Function/extend.php +++ b/Extend/Function/extend.php @@ -368,10 +368,11 @@ function remove_xss($val) { /** * 把返回的数据集转换成Tree - * @access public * @param array $list 要转换的数据集 + * @param string $pk 列表主键 * @param string $pid parent标记字段 - * @param string $level level标记字段 + * @param string $child Tree中子元素所在key + * @param int $root 根元素pid值 * @return array */ function list_to_tree($list, $pk='id',$pid = 'pid',$child = '_child',$root=0) { @@ -401,19 +402,18 @@ function list_to_tree($list, $pk='id',$pid = 'pid',$child = '_child',$root=0) { /** * 对查询结果集进行排序 - * @access public * @param array $list 查询结果 * @param string $field 排序的字段名 - * @param array $sortby 排序类型 - * asc正向排序 desc逆向排序 nat自然排序 + * @param string $sort_by asc正向排序 desc逆向排序 nat自然排序 * @return array */ -function list_sort_by($list,$field, $sortby='asc') { +function list_sort_by($list,$field, $sort_by='asc') { if(is_array($list)){ $refer = $resultSet = array(); foreach ($list as $i => $data) $refer[$i] = &$data[$field]; - switch ($sortby) { + $sort_by = strtolower($sort_by); + switch ($sort_by) { case 'asc': // 正向排序 asort($refer); break; @@ -547,10 +547,11 @@ function addItem($path,&$zip,&$base_dir){ * @param string $hedef 解压到的路径 */ function ezip($zip, $hedef = ''){ - $dirname=preg_replace('/.zip/', '', $zip); + //$dirname=preg_replace('/.zip/', '', $zip); + $dirname = dirname($zip); $root = $_SERVER['DOCUMENT_ROOT'].'/zip/'; $zip = zip_open($root . $zip); - @mkdir($root . $hedef . $dirname.'/'.$zip_dosya); + @mkdir($root . $hedef . $dirname.'/'); while($zip_icerik = zip_read($zip)){ $zip_dosya = zip_entry_name($zip_icerik); if(strpos($zip_dosya, '.')){ From 23ff7b1c5eda6720b54524ca9866a89cc464c9b3 Mon Sep 17 00:00:00 2001 From: koboshi Date: Fri, 3 Jan 2014 15:44:42 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E9=81=BF=E5=85=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=A6=81=E7=94=A8eval=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Extend/Library/ORG/Util/Auth.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Extend/Library/ORG/Util/Auth.class.php b/Extend/Library/ORG/Util/Auth.class.php index a4b8ad5..5fbe243 100644 --- a/Extend/Library/ORG/Util/Auth.class.php +++ b/Extend/Library/ORG/Util/Auth.class.php @@ -158,7 +158,13 @@ protected function getAuthList($uid) { $user = $this->getUserInfo($uid); $command = preg_replace('/\{(\w*?)\}/', '$user[\'\\1\']', $r['condition']); //dump($command);//debug - @(eval('$condition=(' . $command . ');')); + //@(eval('$condition=(' . $command . ');')); + if (defined($command)) { + $condition = $command; + } + else { + $condition = strval($command); + } if ($condition) { $authList[] = $r['name']; }