Skip to content

Commit 490b5c4

Browse files
authored
Better deal with at url parameters that have weird values
If the `at` url parameter contains a value that is neither a date nor a timestamp integer then prevent the date() function to fail due to an illegal parameter type. For example given `&at=xxx` this would happen before this patch.
1 parent e4d58d6 commit 490b5c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doku.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
if ($date_parse) {
6565
$DATE_AT = $date_parse;
6666
} else { // check for UNIX Timestamp
67-
$date_parse = @date('Ymd', $DATE_AT);
67+
$date_parse = @date('Ymd', (int) $DATE_AT);
6868
if (!$date_parse || $date_parse === '19700101') {
6969
msg(sprintf($lang['unable_to_parse_date'], hsc($DATE_AT)));
7070
$DATE_AT = null;

0 commit comments

Comments
 (0)