Last active
August 29, 2015 14:22
-
-
Save nojimage/294d900c9d9e6d3dc772 to your computer and use it in GitHub Desktop.
Inflector fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php | |
index 61a63c2..48b9fa1 100644 | |
--- a/lib/Cake/Utility/Inflector.php | |
+++ b/lib/Cake/Utility/Inflector.php | |
@@ -497,7 +497,7 @@ class Inflector { | |
public static function humanize($lowerCaseAndUnderscoredWord) { | |
if (!($result = self::_cache(__FUNCTION__, $lowerCaseAndUnderscoredWord))) { | |
$lowerCaseAndUnderscoredWord = self::underscore($lowerCaseAndUnderscoredWord); | |
- $result = explode(' ', str_replace('_', ' ', $lowerCaseAndUnderscoredWord)); | |
+ $result = explode(' ', str_replace(['_', '.'], [' ', '. '], $lowerCaseAndUnderscoredWord)); | |
foreach ($result as &$word) { | |
$word = mb_strtoupper(mb_substr($word, 0, 1)) . mb_substr($word, 1); | |
} |
Author
nojimage
commented
Jun 3, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment