From 8c56e6282974059bd6d159c8c7f80baacc68a933 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 8 Nov 2011 19:17:58 +0100 Subject: [PATCH] Fixed class name generation --- .../lib/system/cache/builder/OptionCacheBuilder.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php index 5e8d82cb32..33652b4844 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php @@ -94,13 +94,15 @@ class OptionCacheBuilder implements ICacheBuilder { // get option class from type $className = 'wcf\data\option\Option'; if (!empty($type)) { - preg_match_all('~((?:^|[A-Z])[a-z]+)~', $type, $matches); + // strip trailing underscore + $rawType = substr($type, 0, -1); + preg_match_all('~((?:^|[A-Z])[a-z]+)~', $rawType, $matches); if (isset($matches[1])) { $className = 'wcf\data\\'; - for ($i = 0, $length = sizeof($matches[1]); $i < $length; $i++) { + for ($i = 0, $length = count($matches[1]); $i < $length; $i++) { $className .= $matches[1][$i] . '\\'; } - $className .= ucfirst($type); + $className .= 'option\\' . ucfirst($rawType) . 'Option'; } } -- 2.20.1