Skip to content
This repository
Browse code

Fix inflectino for words ending in media.

Fixes #2149
  • Loading branch information...
commit 7c96f87bd78dc46d69d26adbaa161b936f888a68 1 parent 8ff669d
Mark Story authored
4  cake/libs/inflector.php
@@ -165,12 +165,12 @@ class Inflector {
165 165
 		'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder',
166 166
 		'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti',
167 167
 		'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings',
168  
-		'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', 'media',
  168
+		'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', '.*?media',
169 169
 		'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese',
170 170
 		'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese',
171 171
 		'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors',
172 172
 		'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'swine', 'testes',
173  
-		'trousers', 'trout','tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest',
  173
+		'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest',
174 174
 		'Yengeese'
175 175
 	);
176 176
 
2  cake/tests/cases/libs/inflector.test.php
@@ -78,6 +78,7 @@ function testInflectingSingulars() {
78 78
 		$this->assertEqual(Inflector::singularize('Aliases'), 'Alias');
79 79
 		$this->assertEqual(Inflector::singularize('Alias'), 'Alias');
80 80
 		$this->assertEqual(Inflector::singularize('Media'), 'Media');
  81
+		$this->assertEqual(Inflector::singularize('NodeMedia'), 'NodeMedia');
81 82
 		$this->assertEqual(Inflector::singularize('alumni'), 'alumnus');
82 83
 		$this->assertEqual(Inflector::singularize('bacilli'), 'bacillus');
83 84
 		$this->assertEqual(Inflector::singularize('cacti'), 'cactus');
@@ -147,6 +148,7 @@ function testInflectingPlurals() {
147 148
 		$this->assertEqual(Inflector::pluralize('Alias'), 'Aliases');
148 149
 		$this->assertEqual(Inflector::pluralize('Aliases'), 'Aliases');
149 150
 		$this->assertEqual(Inflector::pluralize('Media'), 'Media');
  151
+		$this->assertEqual(Inflector::pluralize('NodeMedia'), 'NodeMedia');
150 152
 		$this->assertEqual(Inflector::pluralize('alumnus'), 'alumni');
151 153
 		$this->assertEqual(Inflector::pluralize('bacillus'), 'bacilli');
152 154
 		$this->assertEqual(Inflector::pluralize('cactus'), 'cacti');

0 notes on commit 7c96f87

Please sign in to comment.
Something went wrong with that request. Please try again.