From c415a9374872c6235fe822a5e038546522817e3a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 21 Mar 2017 12:18:47 +0100 Subject: Fix a couple of warnings and notices from error.log --- inc/property.inc.php | 8 ++++---- inc/util.inc.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'inc') diff --git a/inc/property.inc.php b/inc/property.inc.php index b3d8081a..b33e1bff 100644 --- a/inc/property.inc.php +++ b/inc/property.inc.php @@ -146,19 +146,19 @@ class Property public static function getVersionCheckInformation() { - $data = json_decode(self::get('versioncheck-data'), true); - if (isset($data['time']) && $data['time'] + 120 > time()) + $data = json_decode(self::get('versioncheck-data', '[]'), true); + if (isset($data['time']) && $data['time'] + 60 > time()) return $data; $task = Taskmanager::submit('DownloadText', array( 'url' => CONFIG_REMOTE_ML . '/list.php' )); if (!isset($task['id'])) return 'Could not start list download (' . Message::asString() . ')'; - if ($task['statusCode'] !== TASK_FINISHED) { + if (!Taskmanager::isFinished($task)) { $task = Taskmanager::waitComplete($task['id'], 5000); } if ($task['statusCode'] !== TASK_FINISHED || !isset($task['data']['content'])) { - return $task['data']['error']; + return isset($task['data']['error']) ? $task['data']['error'] : 'Timeout'; } $data = json_decode($task['data']['content'], true); $data['time'] = time(); diff --git a/inc/util.inc.php b/inc/util.inc.php index d454d18d..f5e10ebc 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -375,7 +375,7 @@ SADFACE; * @param bool $secure true = only use strong random sources * @return string|bool string of requested length, false on error */ - public static function randomBytes($length, $secure) + public static function randomBytes($length, $secure = true) { if (function_exists('random_bytes')) { return random_bytes($length); -- cgit v1.2.3-55-g7522