Merge pull request #4437 from ivantcholakov/3.0-stable
Escape the $separator parameter for humanize() inflector helper
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php
index 96b723c..c064d8d 100644
--- a/system/helpers/inflector_helper.php
+++ b/system/helpers/inflector_helper.php
@@ -219,7 +219,7 @@
*/
function humanize($str, $separator = '_')
{
- return ucwords(preg_replace('/['.$separator.']+/', ' ', trim(MB_ENABLED ? mb_strtolower($str) : strtolower($str))));
+ return ucwords(preg_replace('/['.preg_quote($separator).']+/', ' ', trim(MB_ENABLED ? mb_strtolower($str) : strtolower($str))));
}
}