From ac6d5cc70f2932de5eee17638ac7cd6c264ca9b0 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 9 Dec 2014 21:51:42 -0500 Subject: [PATCH] Fix incorrect pluralization of Human. Human should become humans, unlike other words ending in man. Fixes #5370 --- lib/Cake/Test/Case/Utility/InflectorTest.php | 4 ++++ lib/Cake/Utility/Inflector.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Utility/InflectorTest.php b/lib/Cake/Test/Case/Utility/InflectorTest.php index 1239aa2cb..f600ae757 100644 --- a/lib/Cake/Test/Case/Utility/InflectorTest.php +++ b/lib/Cake/Test/Case/Utility/InflectorTest.php @@ -186,6 +186,10 @@ class InflectorTest extends CakeTestCase { * @return void */ public function testInflectingPlurals() { + $this->assertEquals(Inflector::pluralize('axman'), 'axmen'); + $this->assertEquals(Inflector::pluralize('man'), 'men'); + $this->assertEquals(Inflector::pluralize('woman'), 'women'); + $this->assertEquals(Inflector::pluralize('human'), 'humans'); $this->assertEquals(Inflector::pluralize('categoria'), 'categorias'); $this->assertEquals(Inflector::pluralize('house'), 'houses'); $this->assertEquals(Inflector::pluralize('powerhouse'), 'powerhouses'); diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 74c005e10..a8ca02dfd 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -44,7 +44,7 @@ class Inflector { '/sis$/i' => 'ses', '/([ti])um$/i' => '\1a', '/(p)erson$/i' => '\1eople', - '/(m)an$/i' => '\1en', + '/(? '\1en', '/(c)hild$/i' => '\1hildren', '/(buffal|tomat)o$/i' => '\1\2oes', '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i',