From: Vincent Petry Date: Thu, 3 Oct 2013 12:21:18 +0000 (+0200) Subject: Fixed missing default values X-Git-Tag: v6.0.0alpha2~97^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=006799616d584fc3f83e325910368a8af0aee072;p=nextcloud-server.git Fixed missing default values Added default value for $fromTime to prevent missing argument errors and keep backward compatible. --- diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php index 858134dd8c6..0aa2b27b96b 100644 --- a/lib/private/template/functions.php +++ b/lib/private/template/functions.php @@ -104,9 +104,9 @@ function strip_time($timestamp){ * @param bool $dateOnly whether to strip time information * @return formatted timestamp */ -function relative_modified_date($timestamp, $fromTime, $dateOnly = false) { +function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false) { $l=OC_L10N::get('lib'); - if (!isset($fromTime)){ + if (!isset($fromTime) || $fromTime === null){ $fromTime = time(); } if ($dateOnly){ diff --git a/lib/public/template.php b/lib/public/template.php index 6349501272f..8800f5c856e 100644 --- a/lib/public/template.php +++ b/lib/public/template.php @@ -90,7 +90,7 @@ function human_file_size( $bytes ) { * @param $timestamp unix timestamp * @returns human readable interpretation of the timestamp */ -function relative_modified_date($timestamp, $fromTime, $dateOnly = false) { +function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false) { return(\relative_modified_date($timestamp, $fromTime, $dateOnly)); }