From 5dc4b61771cc324a274a3cb8fda0bc26c906c317 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Mon, 28 Oct 2013 23:56:41 +0000 Subject: [PATCH] - bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159) --- change_log.txt | 1 + libs/plugins/modifier.capitalize.php | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/change_log.txt b/change_log.txt index 58521758..02280937 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ 28.10.2013 - bugfix variable resource name at custom resource plugin did not work within {block} tags (Issue 163) - bugfix notice "Trying to get property of non-object" removed (Issue 163) + - bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159) 20.10.2013 - bugfix a variable file name at {extends} tag did fail (forum topic 24618) diff --git a/libs/plugins/modifier.capitalize.php b/libs/plugins/modifier.capitalize.php index 985c54b4..c019df5f 100644 --- a/libs/plugins/modifier.capitalize.php +++ b/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){