From 1db0a849eb3ba1116d9ed06f1d7176d0c5ce9152 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 31 Jul 2016 15:59:34 +0200 Subject: [PATCH] Force lower case custom URLs for pages --- wcfsetup/install/files/lib/acp/form/PageAddForm.class.php | 2 +- .../install/files/lib/system/request/RouteHandler.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php index 7f4ee640ef..de2148ab01 100644 --- a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php @@ -207,7 +207,7 @@ class PageAddForm extends AbstractForm { if (isset($_POST['isLandingPage'])) $this->isLandingPage = 1; if (isset($_POST['applicationPackageID'])) $this->applicationPackageID = intval($_POST['applicationPackageID']); - if (isset($_POST['customURL']) && is_array($_POST['customURL'])) $this->customURL = ArrayUtil::trim($_POST['customURL']); + if (isset($_POST['customURL']) && is_array($_POST['customURL'])) $this->customURL = array_map('mb_strtolower', ArrayUtil::trim($_POST['customURL'])); if (isset($_POST['title']) && is_array($_POST['title'])) $this->title = ArrayUtil::trim($_POST['title']); if (isset($_POST['content']) && is_array($_POST['content'])) $this->content = ArrayUtil::trim($_POST['content']); if (isset($_POST['metaDescription']) && is_array($_POST['metaDescription'])) $this->metaDescription = ArrayUtil::trim($_POST['metaDescription']); diff --git a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php index ab0df9eb48..99d788d3e3 100644 --- a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php @@ -209,7 +209,7 @@ class RouteHandler extends SingletonFactory { * @since 3.0 */ public static function isValidCustomUrl($customUrl) { - return preg_match('~^[a-zA-Z0-9\-_/]+$~', $customUrl) === 1; + return preg_match('~^[a-z0-9\-_/]+$~', $customUrl) === 1; } /** -- 2.20.1