Permalink
Browse files

Fixing typo.

  • Loading branch information...
1 parent b563393 commit f811a69c87a9b03221c6dabd9aa20f3a3724ae62 @jperras jperras committed Mar 18, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 cake/libs/inflector.php
@@ -236,6 +236,7 @@ function pluralize($word) {
if (isset($_this->pluralized[$word])) {
return $_this->pluralized[$word];
}
+
extract($_this->plural);
$uninflected = array_merge($uninflected, $_this->uninflected);
@@ -244,7 +245,7 @@ function pluralize($word) {
$_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 @@ function singularize($word) {
$_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];
}

0 comments on commit f811a69

Please sign in to comment.