From c7df199a2f6403a22518eb3c5b3ff008b68ecce6 Mon Sep 17 00:00:00 2001 From: Ian Date: Sat, 2 Nov 2013 16:51:24 +0100 Subject: [PATCH] bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159) --- .../Smarty/libs/plugins/modifier.capitalize.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bundled-libs/Smarty/libs/plugins/modifier.capitalize.php b/bundled-libs/Smarty/libs/plugins/modifier.capitalize.php index 6b63e122..c1e3adb1 100644 --- a/bundled-libs/Smarty/libs/plugins/modifier.capitalize.php +++ b/bundled-libs/Smarty/libs/plugins/modifier.capitalize.php @@ -30,7 +30,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals $upper_string = mb_convert_case( $string, MB_CASE_TITLE, Smarty::$_CHARSET ); } else { // uppercase word breaks - $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, smarty_mod_cap_mbconvert_cb('$matches'), $string); + $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert_cb', $string); } // check uc_digits case if (!$uc_digits) { @@ -40,7 +40,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals } } } - $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, smarty_mod_cap_mbconvert2_cb('$matches'), $upper_string); + $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert2_cb', $upper_string); return $upper_string; } @@ -49,7 +49,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals $string = strtolower($string); } // uppercase (including hyphenated words) - $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, smarty_mod_cap_ucfirst_cb('$matches'), $string); + $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst_cb', $string); // check uc_digits case if (!$uc_digits) { if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) { @@ -58,7 +58,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals } } } - $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, smarty_mod_cap_ucfirst2_cb('$matches'), $upper_string); + $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst2_cb', $upper_string); return $upper_string; } @@ -71,11 +71,11 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals * @author Kyle Renfrow */ function smarty_mod_cap_mbconvert_cb($matches){ - return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[2]),MB_CASE_UPPER, "' . addslashes(Smarty::$_CHARSET) . '"); + return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[2]),MB_CASE_UPPER, Smarty::$_CHARSET); } function smarty_mod_cap_mbconvert2_cb($matches){ - return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[3]),MB_CASE_UPPER, "' . addslashes(Smarty::$_CHARSET) . '"); + return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[3]),MB_CASE_UPPER, Smarty::$_CHARSET); } function smarty_mod_cap_ucfirst_cb($matches){