diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-06-24 07:37:21 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-06-24 07:37:21 -0700 |
commit | 754bc86ec8587499f5b42badc2777a6654dba19c (patch) | |
tree | e508017acc910ff9516a377e83a1e0dc9920b50c | |
parent | bca2eb39fa1950a72e159dd6cc44598c387a927a (diff) | |
parent | 3e3b66bd0d9a44ef43b6699220180a2b76b5df0e (diff) | |
download | nextcloud-server-754bc86ec8587499f5b42badc2777a6654dba19c.tar.gz nextcloud-server-754bc86ec8587499f5b42badc2777a6654dba19c.zip |
Merge pull request #3826 from owncloud/fix_webdav_locking_for_oracle
use to_char when comparing clob to string on oracle, use execute audited
-rw-r--r-- | lib/connector/sabre/locks.php | 4 | ||||
-rw-r--r-- | lib/connector/sabre/node.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/connector/sabre/locks.php b/lib/connector/sabre/locks.php index cbc495dec19..7aca2e43712 100644 --- a/lib/connector/sabre/locks.php +++ b/lib/connector/sabre/locks.php @@ -176,6 +176,10 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract { public function unlock($uri, Sabre_DAV_Locks_LockInfo $lockInfo) { $sql = 'DELETE FROM `*PREFIX*locks` WHERE `userid` = ? AND `uri` = ? AND `token` = ?'; + if (OC_Config::getValue( "dbtype") === 'oci') { + //FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison + $sql = 'DELETE FROM `*PREFIX*locks` WHERE `userid` = ? AND to_char(`uri`) = ? AND `token` = ?'; + } $result = OC_DB::executeAudited( $sql, array(OC_User::getUser(), $uri, $lockInfo->token)); return $result->numRows() === 1; diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php index 1ffa048d6b2..0bffa58af78 100644 --- a/lib/connector/sabre/node.php +++ b/lib/connector/sabre/node.php @@ -189,8 +189,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr */ public function getProperties($properties) { if (is_null($this->property_cache)) { - $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?' ); - $result = $query->execute( array( OC_User::getUser(), $this->path )); + $sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'; + $result = OC_DB::executeAudited( $sql, array( OC_User::getUser(), $this->path ) ); $this->property_cache = array(); while( $row = $result->fetchRow()) { |