dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix r71751 problems with textual parameters.
[lhc/web/wiklou.git]
/
includes
/
GlobalFunctions.php
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
a7b0696
..
04b0e6b
100644
(file)
--- a/
includes/GlobalFunctions.php
+++ b/
includes/GlobalFunctions.php
@@
-1948,7
+1948,7
@@
function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) {
$da = array();
$strtime = '';
$da = array();
$strtime = '';
- if (
$ts == 0 ) { // This intentionally catches $ts === '' and $ts === null too, so DON'T change this to ===
+ if (
!$ts ) { // We want to catch 0, '', null... but not date strings starting with a letter.
$uts = time();
$strtime = "@$uts";
} elseif ( preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/D', $ts, $da ) ) {
$uts = time();
$strtime = "@$uts";
} elseif ( preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/D', $ts, $da ) ) {
@@
-1988,7
+1988,7
@@
function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) {
# asctime
$strtime = $ts;
} else {
# asctime
$strtime = $ts;
} else {
- # Bogus value
; fall back to the epoch
...
+ # Bogus value...
wfDebug("wfTimestamp() fed bogus time value: TYPE=$outputtype; VALUE=$ts\n");
return false;
wfDebug("wfTimestamp() fed bogus time value: TYPE=$outputtype; VALUE=$ts\n");
return false;