]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed missing default values
authorVincent Petry <pvince81@owncloud.com>
Thu, 3 Oct 2013 12:21:18 +0000 (14:21 +0200)
committerVincent Petry <pvince81@owncloud.com>
Thu, 3 Oct 2013 12:21:41 +0000 (14:21 +0200)
Added default value for $fromTime to prevent missing argument errors and
keep backward compatible.

lib/private/template/functions.php
lib/public/template.php

index 858134dd8c6043532588fc4478dc90796e02d4fc..0aa2b27b96be5dde13d6663dd4d1b8a26d0e5e4d 100644 (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){
index 6349501272fb93e6323d2e91c3aadcc0d5c0bf88..8800f5c856ec01fa29951de8ad7e7c1e44c0c6fa 100644 (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));
 }