Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Placing uninflected check before irregular rules. Refs [8169] and #6351

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8170 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit 8b24d976f2e4617a758bef5f665ffdd5ebd74ea7 1 parent 109bda9
@markstory markstory authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 cake/libs/inflector.php
View
10 cake/libs/inflector.php
@@ -385,16 +385,16 @@ function singularize($word) {
$_this->singularRules['regexIrregular'] = $regexIrregular;
}
- if (preg_match('/(.*)\\b(' . $regexIrregular . ')$/i', $word, $regs)) {
- $_this->singularized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1);
- return $_this->singularized[$word];
- }
-
if (preg_match('/^(' . $regexUninflected . ')$/i', $word, $regs)) {
$_this->singularized[$word] = $word;
return $word;
}
+ if (preg_match('/(.*)\\b(' . $regexIrregular . ')$/i', $word, $regs)) {
+ $_this->singularized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1);
+ return $_this->singularized[$word];
+ }
+
foreach ($singularRules as $rule => $replacement) {
if (preg_match($rule, $word)) {
$_this->singularized[$word] = preg_replace($rule, $replacement, $word);
Please sign in to comment.
Something went wrong with that request. Please try again.