Fixed missing default values

Added default value for $fromTime to prevent missing argument errors and
keep backward compatible.
This commit is contained in:
Vincent Petry 2013-10-03 14:21:18 +02:00
parent b0bb64c3ee
commit 006799616d
2 changed files with 3 additions and 3 deletions

View File

@ -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){

View File

@ -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));
}