summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-12-03 20:38:22 +0000
committerDries Buytaert <dries@buytaert.net>2004-12-03 20:38:22 +0000
commit6a95a002598c2b80a7fbf595573bf2c1d065c5ae (patch)
treee220ae4faffe23e9fb59a283d2c0aaeb359b3d43
parentd3fb126d3e709f1e02ba89b0e826f402400043be (diff)
downloadbrdo-6a95a002598c2b80a7fbf595573bf2c1d065c5ae.tar.gz
brdo-6a95a002598c2b80a7fbf595573bf2c1d065c5ae.tar.bz2
- Patch #7058 by Neil: format_date does not properly handle escaped characters.
-rw-r--r--includes/common.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 83e0a54e4..e49cbb851 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -789,7 +789,9 @@ function format_interval($timestamp, $granularity = 2) {
* The format to use. Can be "small", "medium" or "large" for the preconfigured
* date formats. If "custom" is specified, then $format is required as well.
* @param $format
- * A PHP date format string as required by date().
+ * A PHP date format string as required by date(). A backslash should be used
+ * before a character to avoid interpreting the character as part of a date
+ * format.
* @param $timezone
* Time zone offset in seconds; if omitted, the user's time zone is used.
* @return
@@ -842,6 +844,9 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
else if ($c == 'Z') {
$date .= $timezone;
}
+ else if ($c == '\\') {
+ $date .= $format[++$i];
+ }
else {
$date .= $c;
}