diff --git a/NEWS b/NEWS index 93e0322d..6894779a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fix capitalize modifier, don't rely on buggy ucwords (Monte) - make html_select_date work with negative timestamps, also force year range to include given date unless explicitly set (Garo, Monte) diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index abd766cc..5e21b6fb 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -130,8 +130,7 @@ function smarty_function_html_select_date($params, &$smarty) } // If $time is not in format yyyy-mm-dd if (!preg_match('/^\d{0,4}-\d{0,2}-\d{0,2}$/', $time)) { - // then $time is empty or unix timestamp or mysql timestamp - // using smarty_make_timestamp to get an unix timestamp and + // use smarty_make_timestamp to get an unix timestamp and // strftime to make yyyy-mm-dd $time = strftime('%Y-%m-%d', smarty_make_timestamp($time)); } diff --git a/libs/plugins/modifier.capitalize.php b/libs/plugins/modifier.capitalize.php index adf862b3..5748ab3d 100644 --- a/libs/plugins/modifier.capitalize.php +++ b/libs/plugins/modifier.capitalize.php @@ -19,7 +19,7 @@ */ function smarty_modifier_capitalize($string) { - return ucwords($string); + return preg_replace_callback('!\b[a-z]!', create_function('$_x', 'return strtoupper($_x[0]);'), $string); } ?>