Added system option to enable case insensitive urls. (#1638)

This commit is contained in:
Antony Dabonde
2017-09-06 05:58:57 +10:00
committed by Andy Miller
parent 96028d1d69
commit 481fe1903e
2 changed files with 16 additions and 0 deletions

View File

@@ -1163,6 +1163,17 @@ form:
validate:
type: bool
case_insensitive_urls:
type: toggle
label: PLUGIN_ADMIN.CASE_INSENSITIVE_URLS
highlight: 0
help: PLUGIN_ADMIN.CASE_INSENSITIVE_URLS_HELP
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
param_sep:
type: select
size: medium

View File

@@ -286,6 +286,11 @@ class Uri
$this->url = $this->base . $this->uri;
// if case insensitive urls is enabled, lowercase the url
if( $grav['config']->get('system.case_insensitive_urls') ){
$this->url = strtolower($this->url);
}
// get any params and remove them
$uri = str_replace($this->root, '', $this->url);