* adjust code.

This commit is contained in:
wangyidong
2015-06-12 11:18:44 +08:00
parent 353bb5160f
commit 598ec01ccc
2 changed files with 3 additions and 2 deletions

View File

@@ -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);

View File

@@ -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);
}
/**