From 8f00f2141383da553bd4c8fff9a3d9c0a4e4cf45 Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Thu, 14 Feb 2013 16:47:00 +0100 Subject: Check if glob() returns some matches before continue, this should fix issue 1690 --- apps/files_versions/lib/versions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 5cf11759da4..08e5c4f87e1 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -94,10 +94,12 @@ class Storage { if ($uid == \OCP\User::getUser()) { $versionsName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename); $matches=glob($versionsName.'.v*'); - sort($matches); - $parts=explode('.v',end($matches)); - if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) { - return false; + if ( $matches ) { + sort($matches); + $parts=explode('.v',end($matches)); + if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) { + return false; + } } } -- cgit v1.2.3