Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dwoo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Common
Dwoo
Commits
13f4eaae
Commit
13f4eaae
authored
Nov 14, 2008
by
seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed date_format handling of negative and small unix timestamps
git-svn-id:
svn://dwoo.org/dwoo/trunk@217
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
ac01ee14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
CHANGELOG
CHANGELOG
+1
-0
date_format.php
lib/plugins/builtin/functions/date_format.php
+2
-2
No files found.
CHANGELOG
View file @
13f4eaae
[
2008
--]
1.0.1
[
2008
--]
1.0.1
*
Fixed
a
{
foreach
}
bug
with
the
implode
argument
*
Fixed
a
{
foreach
}
bug
with
the
implode
argument
*
Fixed
modulo
operator
in
if
statements
*
Fixed
modulo
operator
in
if
statements
*
Fixed
date_format
handling
of
negative
and
small
unix
timestamps
[
2008
-
10
-
23
]
1.0.0
[
2008
-
10
-
23
]
1.0.0
! BC Break: Small one that probably won't affect anyone, but it makes the
! BC Break: Small one that probably won't affect anyone, but it makes the
...
...
lib/plugins/builtin/functions/date_format.php
View file @
13f4eaae
...
@@ -22,12 +22,12 @@ function Dwoo_Plugin_date_format(Dwoo $dwoo, $value, $format='%b %e, %Y', $defau
...
@@ -22,12 +22,12 @@ function Dwoo_Plugin_date_format(Dwoo $dwoo, $value, $format='%b %e, %Y', $defau
{
{
if
(
!
empty
(
$value
))
{
if
(
!
empty
(
$value
))
{
// convert if it's not a valid unix timestamp
// convert if it's not a valid unix timestamp
if
(
preg_match
(
'#^
\d{
10}$#'
,
$value
)
===
0
)
{
if
(
preg_match
(
'#^
-?\d{1,
10}$#'
,
$value
)
===
0
)
{
$value
=
strtotime
(
$value
);
$value
=
strtotime
(
$value
);
}
}
}
elseif
(
!
empty
(
$default
))
{
}
elseif
(
!
empty
(
$default
))
{
// convert if it's not a valid unix timestamp
// convert if it's not a valid unix timestamp
if
(
preg_match
(
'#^
\d{
10}$#'
,
$default
)
===
0
)
{
if
(
preg_match
(
'#^
-?\d{1,
10}$#'
,
$default
)
===
0
)
{
$value
=
strtotime
(
$default
);
$value
=
strtotime
(
$default
);
}
else
{
}
else
{
$value
=
$default
;
$value
=
$default
;
...
...
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