Skip to content

Commit

Permalink
fix redirect url include "&" and "?" operaters.
Browse files Browse the repository at this point in the history
  • Loading branch information
hinashiki committed May 13, 2016
1 parent 21da40f commit 92b4cc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ public function check_redirect()
if(\Fuel\Core\Input::get('page') === '1')
{
$redirect_flg = true;
$redirect_uri = preg_replace('/(&?)(page=1&?)/', '$1', $redirect_uri);
$redirect_uri = preg_replace('/[&?](page=1&?)/', '$1', $redirect_uri);
}

// last &, ? check (301 redirect)
if(preg_match('/[&\?]$/', $redirect_uri))
if(empty(\Input::get()) and preg_match('/[&\?]$/', $redirect_uri))
{
$redirect_flg = true;
$redirect_uri = preg_replace('/[&\?]$/', '', $redirect_uri);
Expand Down

0 comments on commit 92b4cc2

Please sign in to comment.