Fix for blog filter #1370
This commit is contained in:
parent
4f20b3dbe2
commit
847c59e233
2 changed files with 9 additions and 6 deletions
|
@ -6,11 +6,13 @@ if ($url->uri()==HTML_PATH_ROOT.ADMIN_URI_FILTER) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect blog, from /blog to /blog/
|
// Redirect blog, from /blog to /blog/
|
||||||
// This rule only works when the user set a page as homepage
|
// If the user define the blog's filter as "myblog" the redirection will be from /myblog to /myblog/
|
||||||
if ($url->uri()==HTML_PATH_ROOT.'blog' && $site->homepage()) {
|
if ($site->homepage()) {
|
||||||
$filter = $url->filters('blog');
|
$filter = $url->filters('blog');
|
||||||
$finalURL = Text::addSlashes(DOMAIN_BASE.$filter, false, true);
|
if ($url->uri()==HTML_PATH_ROOT.$filter) {
|
||||||
Redirect::url($finalURL);
|
$finalURL = Text::addSlashes(DOMAIN_BASE.$filter, false, true);
|
||||||
|
Redirect::url($finalURL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect pages, from /my-page/ to /my-page
|
// Redirect pages, from /my-page/ to /my-page
|
||||||
|
|
|
@ -114,7 +114,8 @@ class Url
|
||||||
return $this->uri;
|
return $this->uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the filter filter by type
|
// Return the string defined by the user for the blog filter
|
||||||
|
// The string can be set in the admin panel > settings > advanced > url filters > blog
|
||||||
public function filters($type, $trim=true)
|
public function filters($type, $trim=true)
|
||||||
{
|
{
|
||||||
$filter = $this->filters[$type];
|
$filter = $this->filters[$type];
|
||||||
|
|
Loading…
Reference in a new issue