[Pkg-owncloud-commits] [owncloud] 10/85: Fix getPathById for Oracle

David Prévot taffit at moszumanska.debian.org
Tue Jun 17 19:12:40 UTC 2014


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

taffit pushed a commit to branch 6.0
in repository owncloud.

commit 37e29169e0030742750f220b747f56e98d38cdea
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Thu May 8 13:33:55 2014 +0200

    Fix getPathById for Oracle
    
    Added extra code to handle the case of Oracle which saves empty strings
    as null values.
    
    Backport of 05dc694 from master
---
 lib/private/files/cache/cache.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index b5e27d6..e259513 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -589,6 +589,10 @@ class Cache {
 		$sql = 'SELECT `path` FROM `*PREFIX*filecache` WHERE `fileid` = ? AND `storage` = ?';
 		$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
 		if ($row = $result->fetchRow()) {
+			// Oracle stores empty strings as null...
+			if ($row['path'] === null) {
+				return '';
+			}
 			return $row['path'];
 		} else {
 			return null;

-- 
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