From: Tim Düsterhus Date: Sun, 31 Jul 2016 13:59:34 +0000 (+0200) Subject: Force lower case custom URLs for pages X-Git-Tag: 3.0.0_Beta_1~839 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1db0a849eb3ba1116d9ed06f1d7176d0c5ce9152;p=GitHub%2FWoltLab%2FWCF.git Force lower case custom URLs for pages --- 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; } /**