X-Git-Url: http://git.onelab.eu/?p=www-register-wizard.git;a=blobdiff_plain;f=helpers%2Finflector_helper.php;h=e65968a9d6200c155927da1014cf69afc0e6869f;hp=9393f11e4872a34a1fec0251874379578bcf3c25;hb=47598daa8c32dbbd72db83dc33f2ce91b3f6f7b0;hpb=4afb2fe256f094a1caf6bff14f51c6a88938cc9f diff --git a/helpers/inflector_helper.php b/helpers/inflector_helper.php index 9393f11..e65968a 100644 --- a/helpers/inflector_helper.php +++ b/helpers/inflector_helper.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 @@ -87,7 +87,9 @@ if ( ! function_exists('plural')) if ($end == 'y') { - $str = substr($str, 0, strlen($str)-1).'ies'; + // Y preceded by vowel => regular plural + $vowels = array('a', 'e', 'i', 'o', 'u'); + $str = in_array(substr($str, -2, 1), $vowels) ? $str.'s' : substr($str, 0, -1).'ies'; } elseif ($end == 's') {