diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 3dc5b2fc5c6..badf3d519f3 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -249,16 +249,16 @@ function pluralize($word) { $_this->pluralRules['regexIrregular'] = $regexIrregular; } - if (preg_match('/(.*)\\b(' . $regexIrregular . ')$/i', $word, $regs)) { - $_this->pluralized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1); - return $_this->pluralized[$word]; - } - if (preg_match('/^(' . $regexUninflected . ')$/i', $word, $regs)) { $_this->pluralized[$word] = $word; return $word; } + if (preg_match('/(.*)\\b(' . $regexIrregular . ')$/i', $word, $regs)) { + $_this->pluralized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1); + return $_this->pluralized[$word]; + } + foreach ($pluralRules as $rule => $replacement) { if (preg_match($rule, $word)) { $_this->pluralized[$word] = preg_replace($rule, $replacement, $word);