Skip to content

Commit

Permalink
Reverting change to regex greediness.
Browse files Browse the repository at this point in the history
  • Loading branch information
jperras committed Mar 18, 2009
1 parent 6068549 commit a9952e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/inflector.php
Expand Up @@ -288,7 +288,7 @@ function singularize($word) {
$_this->singular['cacheIrregular'] = '(?:' . join( '|', array_keys($irregular)) . ')';
}

if (preg_match('/(.+?)\\b(' . $_this->singular['cacheIrregular'] . ')$/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];
}
Expand Down

0 comments on commit a9952e9

Please sign in to comment.