Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
6a95a002
Commit
6a95a002
authored
Dec 03, 2004
by
Dries
Browse files
- Patch
#7058
by Neil: format_date does not properly handle escaped characters.
parent
d3fb126d
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
6a95a002
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment