From 760c0c5998ebede83b564ce05be6688cae502f6a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 19 Feb 2015 16:35:18 +0100 Subject: [PATCH] Fixed error handling for controller aliasing --- .../system/option/UrlControllerReplacementOptionType.class.php | 3 ++- wcfsetup/install/lang/de.xml | 3 ++- wcfsetup/install/lang/en.xml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/option/UrlControllerReplacementOptionType.class.php b/wcfsetup/install/files/lib/system/option/UrlControllerReplacementOptionType.class.php index b06a269e63..30e59861d6 100644 --- a/wcfsetup/install/files/lib/system/option/UrlControllerReplacementOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/UrlControllerReplacementOptionType.class.php @@ -42,7 +42,7 @@ class UrlControllerReplacementOptionType extends TextareaOptionType { $controllers = array(); for ($i = 0, $length = count($lines); $i < $length; $i++) { $line = $lines[$i]; - if (preg_match('~^(?P[a-z0-9\-]+)=(?P[a-z0-9\-]+)$~', $line, $matches)) { + if (preg_match('~^(?P[a-z][a-z0-9\-]+)=(?P[a-z][a-z0-9\-]+)$~', $line, $matches)) { // check if there is already a replacement for given controller if (in_array($matches['controller'], $controllers)) { WCF::getTPL()->assign('urlControllerReplacementError', $matches['controller']); @@ -71,6 +71,7 @@ class UrlControllerReplacementOptionType extends TextareaOptionType { } } else { + WCF::getTPL()->assign('urlControllerReplacementError', $line); throw new UserInputException($option->optionName, 'controllerReplacementInvalidFormat', array('line' => $line)); } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 3632ff2b07..6f271aec21 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -740,7 +740,8 @@ - + + maxvalue !== null} Der maximale Wert ist {#$option->maxvalue}.{/if}]]> minvalue !== null} Der minimale Wert ist {#$option->minvalue}.{/if}]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index ea3ebd6c4f..9d24f1fb43 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -739,7 +739,8 @@ Examples for medium ID detection: - + + maxvalue !== null} of {#$option->maxvalue}{/if}.]]> minvalue !== null} of {#$option->minvalue}{/if}.]]> -- 2.20.1