From 37e29169e0030742750f220b747f56e98d38cdea Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 8 May 2014 13:33:55 +0200 Subject: [PATCH] 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 b5e27d6fa6e..e2595132557 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;