Permalink
Browse files

Fix navigation links

  • Loading branch information...
1 parent 18c0f7e commit 8bc2f3a9e2bb4660d803f205367fe59a08a23b07 Daniel Muller committed with Daniel Muller Feb 25, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 views/paginator.html.php
View
10 views/paginator.html.php
@@ -47,12 +47,14 @@
# SEO pagination (http://www.milesjcarter.co.uk/blog/photos-on-the-web/gallery-3-seo-part-perfect-url-scheme/)
function seo_pagination($url) {
$pattern = '/\?page=([0-9]+)/';
- $replacement = 'page/$1';
+ $replacement = '/page/$1';
+ $url=preg_replace($pattern, $replacement, $url);
#REMOVE REDUNDANT /PAGE/1"
- $pattern2 = '/page\/1$/';
- $replacement2 = '';
+ $pattern = '/\/page\/1$/';
+ $replacement = '';
$url=preg_replace($pattern, $replacement, $url);
- $url=preg_replace($pattern2, $replacement2, $url);
+ #Remove leading double slash
+ $url=preg_replace('/^\/\//', '/', $url);
return $url;
}

0 comments on commit 8bc2f3a

Please sign in to comment.