cvs: smarty / NEWS /libs/plugins function.html_select_date.php modifier.capitalize.php
"Monte Ohrt" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmohrt1093286052@cvsserver> |
mohrt Mon Aug 23 14:34:12 2004 EDT
Modified files:
/smarty NEWS
/smarty/libs/plugins function.html_select_date.php
modifier.capitalize.php
Log:
fix capitalize modifier to not rely on buggy ucwords() func
http://cvs.php.net/diff.php/smarty/NEWS?r1=1.468&r2=1.469&ty=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.468 smarty/NEWS:1.469
--- smarty/NEWS:1.468 Fri Aug 20 09:48:46 2004
+++ smarty/NEWS Mon Aug 23 14:34:12 2004
@@ -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)
http://cvs.php.net/diff.php/smarty/libs/plugins/function.html_select_date.php?r1=1.27&r2=1.28&ty=u
Index: smarty/libs/plugins/function.html_select_date.php
diff -u smarty/libs/plugins/function.html_select_date.php:1.27 smarty/libs/plugins/function.html_select_date.php:1.28
--- smarty/libs/plugins/function.html_select_date.php:1.27 Fri Aug 20 09:53:04 2004
+++ smarty/libs/plugins/function.html_select_date.php Mon Aug 23 14:34:12 2004
@@ -130,8 +130,7 @@
}
// 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));
}
http://cvs.php.net/diff.php/smarty/libs/plugins/modifier.capitalize.php?r1=1.3&r2=1.4&ty=u
Index: smarty/libs/plugins/modifier.capitalize.php
diff -u smarty/libs/plugins/modifier.capitalize.php:1.3 smarty/libs/plugins/modifier.capitalize.php:1.4
--- smarty/libs/plugins/modifier.capitalize.php:1.3 Fri Dec 19 12:18:56 2003
+++ smarty/libs/plugins/modifier.capitalize.php Mon Aug 23 14:34:12 2004
@@ -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);
}
?>
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php