From f811a69c87a9b03221c6dabd9aa20f3a3724ae62 Mon Sep 17 00:00:00 2001 From: jperras Date: Wed, 18 Mar 2009 01:42:22 -0400 Subject: [PATCH] Fixing typo. --- cake/libs/inflector.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index cc731ac31..bf55acf78 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -236,6 +236,7 @@ class Inflector extends Object { if (isset($_this->pluralized[$word])) { return $_this->pluralized[$word]; } + extract($_this->plural); $uninflected = array_merge($uninflected, $_this->uninflected); @@ -244,7 +245,7 @@ class Inflector extends Object { $_this->plural['cacheIrregular'] = '(?:' . join( '|', array_keys($irregular)) . ')'; } - if (preg_match('/(.+?)\\b(' . $_this->plural['cacheIrregular'] . ')$/i', $word, $regs)) { + if (preg_match('/(.*)\\b(' . $_this->plural['cacheIrregular'] . ')$/i', $word, $regs)) { $_this->pluralized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1); return $_this->pluralized[$word]; } @@ -287,7 +288,7 @@ class Inflector extends Object { $_this->singular['cacheIrregular'] = '(?:' . join( '|', array_keys($irregular)) . ')'; } - if (preg_match('/(.+?)\\b(' . $_this->singular['cacheUninflected'] . ')$/i', $word, $regs)) { + if (preg_match('/(.+?)\\b(' . $_this->singular['cacheIrregular'] . ')$/i', $word, $regs)) { $_this->singularized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1); return $_this->singularized[$word]; }