|
@@ -62,7 +62,7 @@ function checkSeccode($nchash,$value){
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 设置cookie QQ wap 登录 by 33h ao.co m
|
|
|
+ * 设置cookie QQ wap 登录 by 33h ao.co m
|
|
|
*
|
|
|
* @param string $name cookie 的名称
|
|
|
* @param string $value cookie 的值
|
|
@@ -437,7 +437,7 @@ function Model($model = null, $base_path = null)
|
|
|
if (!is_null($model) && isset($_cache[$cache_key])) {
|
|
|
return $_cache[$cache_key];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$base_path = $base_path == null ? BASE_DATA_PATH : $base_path;
|
|
|
$file_name = $base_path.'/model/'.$model.'.model.php';
|
|
|
$class_name = $model.'Model';
|
|
@@ -1218,13 +1218,13 @@ function import($libname,$file_ext='.php'){
|
|
|
$path = str_replace('#','.',$path);
|
|
|
}
|
|
|
//返回安全路径
|
|
|
-
|
|
|
+
|
|
|
if(preg_match('/^[\w\d\/_.]+$/i', $path)){
|
|
|
- $file = realpath($base_dir.$path.$file_ext);
|
|
|
+ $file = realpath($base_dir.$path.$file_ext);
|
|
|
}else{
|
|
|
$file = false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!$file){
|
|
|
exit($path.$file_ext.' isn\'t exists!');
|
|
|
}else{
|
|
@@ -1472,6 +1472,7 @@ function pagecmd($cmd ='', $arg = ''){
|
|
|
case 'seteachnum': $page->setEachNum($arg);break;
|
|
|
case 'settotalnum': $page->setTotalNum($arg);break;
|
|
|
case 'setnowpage': $page->setNowPage($arg);break;
|
|
|
+ case 'settotalpage': $page->setTotalPage();break;
|
|
|
case 'setstyle': $page->setStyle($arg);break;
|
|
|
case 'show': return $page->show($arg);break;
|
|
|
case 'obj': return $page;break;
|
|
@@ -1689,8 +1690,8 @@ function rcache($key = null, $prefix = '', $fields = '*')
|
|
|
if ($cache_info === false) {
|
|
|
//取单个字段且未被缓存
|
|
|
$data = array();
|
|
|
- }
|
|
|
- elseif (is_array($cache_info))
|
|
|
+ }
|
|
|
+ elseif (is_array($cache_info))
|
|
|
{
|
|
|
//如果有一个键值为false(即未缓存),则整个函数返回空,让系统重新生成全部缓存
|
|
|
$data = $cache_info;
|
|
@@ -1701,7 +1702,7 @@ function rcache($key = null, $prefix = '', $fields = '*')
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
//string 取单个字段且被缓存
|
|
@@ -1749,7 +1750,7 @@ function dcache($key = null, $prefix = '')
|
|
|
if ($key===null || !C('cache_open')) {
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$ins = Cache::getInstance('cacheredis');
|
|
|
return $ins->hdel($key, $prefix);
|
|
|
}
|