Force lower case custom URLs for pages
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 31 Jul 2016 13:59:34 +0000 (15:59 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Sun, 31 Jul 2016 13:59:51 +0000 (15:59 +0200)
wcfsetup/install/files/lib/acp/form/PageAddForm.class.php
wcfsetup/install/files/lib/system/request/RouteHandler.class.php

index 7f4ee640efdb3a2c9149569e9569a28fd1f18ba1..de2148ab01cf9d710a91e8ecb06b7e87522bf438 100644 (file)
@@ -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']);
index ab0df9eb483b034a8973264459b6d0ac7d41a3e5..99d788d3e326daf8a2beaba70b981a0709cedc22 100644 (file)
@@ -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;
        }
        
        /**