]> source.dussan.org Git - nextcloud-server.git/commitdiff
use to_char when comparing clob to string on oracle, use execute audited
authorJörn Friedrich Dreyer <jfd@butonic.de>
Mon, 24 Jun 2013 14:12:21 +0000 (16:12 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Mon, 24 Jun 2013 14:12:21 +0000 (16:12 +0200)
lib/connector/sabre/locks.php
lib/connector/sabre/node.php

index cbc495dec19b8ce6699e6507dac0e1b83d1c5982..7aca2e437129714038ef0a3ffff6d1ccd0064c70 100644 (file)
@@ -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;
index 1ffa048d6b23b8725538ee5c80673ae18ea6cb93..0bffa58af78b9efe3a3688c0afb749054b34a1e3 100644 (file)
@@ -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()) {