Authored by hf

code review by fei.hong: do modify check is mobile access

... ... @@ -49,7 +49,10 @@ class WebAction extends Controller_Abstract
*/
public function init()
{
$this->isAjax() || Mobile::isGoMobile();
if (!$this->isAjax()) {
Mobile::isGoMobile();
}
$this->_request = $this->getRequest();
// 设置环境变量
... ...
... ... @@ -71,7 +71,7 @@ class Mobile
//
// $continueList = array('www', 'list', 'search');
// $hostSplit = explode('.', $host);
return 'm.yohobuy.com';
return 'm.yohobuy.com' . $uri;
}
/**
... ... @@ -112,10 +112,9 @@ class Mobile
public static function isGoMobile()
{
if (empty($_COOKIE['m2w']) && self::isMobile()) {
$newUrl = self::getNewUrl();
Header("HTTP/1.1 301 Moved Permanently");
header('Location:http://'.$newUrl);
exit;
header("HTTP/1.1 301 Moved Permanently");
header('Location:http://'.self::getNewUrl());
exit();
}
return true;
}
... ...