Authored by hf

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

@@ -49,7 +49,10 @@ class WebAction extends Controller_Abstract @@ -49,7 +49,10 @@ class WebAction extends Controller_Abstract
49 */ 49 */
50 public function init() 50 public function init()
51 { 51 {
52 - $this->isAjax() || Mobile::isGoMobile(); 52 + if (!$this->isAjax()) {
  53 + Mobile::isGoMobile();
  54 + }
  55 +
53 $this->_request = $this->getRequest(); 56 $this->_request = $this->getRequest();
54 57
55 // 设置环境变量 58 // 设置环境变量
@@ -71,7 +71,7 @@ class Mobile @@ -71,7 +71,7 @@ class Mobile
71 // 71 //
72 // $continueList = array('www', 'list', 'search'); 72 // $continueList = array('www', 'list', 'search');
73 // $hostSplit = explode('.', $host); 73 // $hostSplit = explode('.', $host);
74 - return 'm.yohobuy.com'; 74 + return 'm.yohobuy.com' . $uri;
75 } 75 }
76 76
77 /** 77 /**
@@ -112,10 +112,9 @@ class Mobile @@ -112,10 +112,9 @@ class Mobile
112 public static function isGoMobile() 112 public static function isGoMobile()
113 { 113 {
114 if (empty($_COOKIE['m2w']) && self::isMobile()) { 114 if (empty($_COOKIE['m2w']) && self::isMobile()) {
115 - $newUrl = self::getNewUrl();  
116 - Header("HTTP/1.1 301 Moved Permanently");  
117 - header('Location:http://'.$newUrl);  
118 - exit; 115 + header("HTTP/1.1 301 Moved Permanently");
  116 + header('Location:http://'.self::getNewUrl());
  117 + exit();
119 } 118 }
120 return true; 119 return true;
121 } 120 }