From 598ec01ccc717564c62ebf4d1781b05abdd34e4f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 12 Jun 2015 11:18:44 +0800 Subject: [PATCH] * adjust code. --- framework/control.class.php | 2 +- lib/filter/filter.class.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/control.class.php b/framework/control.class.php index e798b855c9..f108ebe71b 100755 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -297,7 +297,7 @@ class control /* The main view file, extension view file and hook file. */ $mainViewFile = $modulePath . 'view' . $this->pathFix . $this->viewPrefix . $methodName . '.' . $viewType . '.php'; $extViewFile = $viewExtPath . $this->viewPrefix . $methodName . ".{$viewType}.php"; - $extHookFiles = glob($viewExtPath . $this->viewPrefix . $methodName . "*.{$viewType}.hook.php"); + $extHookFiles = glob($viewExtPath . $this->viewPrefix . $methodName . ".*.{$viewType}.hook.php"); $viewFile = file_exists($extViewFile) ? $extViewFile : $mainViewFile; if(!is_file($viewFile)) $this->app->triggerError("the view file $viewFile not found", __FILE__, __LINE__, $exit = true); diff --git a/lib/filter/filter.class.php b/lib/filter/filter.class.php index eb942bf3de..310b95980f 100755 --- a/lib/filter/filter.class.php +++ b/lib/filter/filter.class.php @@ -214,7 +214,8 @@ class validater public static function checkAccount($var) { global $config; - return self::checkREG($var, $config->accountRule); + $accountRule = empty($config->accountRule) ? '|^[a-zA-Z0-9_]{1}[a-zA-Z0-9_\.]{1,}[a-zA-Z0-9_]{1}$|' : $config->accountRule; + return self::checkREG($var, $accountRule); } /**