[Pkg-owncloud-commits] [owncloud] 346/394: Check if glob() returns some matches before continue, this should fix issue 1690

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:12:46 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 8f00f2141383da553bd4c8fff9a3d9c0a4e4cf45
Author: Björn Schießle <schiessle at owncloud.com>
Date:   Thu Feb 14 16:47:00 2013 +0100

    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 5cf1175..08e5c4f 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;
+					}
 				}
 			}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list