Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
c2fc6d3d3233e59c10e3c2d34e563bf8878d5691
1 parent
3233aa92
code review by fei.hong: do modify check is mobile access
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
library/Action/WebAction.php
library/WebPlugin/Mobile.php
library/Action/WebAction.php
View file @
c2fc6d3
...
...
@@ -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
();
// 设置环境变量
...
...
library/WebPlugin/Mobile.php
View file @
c2fc6d3
...
...
@@ -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
;
}
...
...
Please
register
or
login
to post a comment