use to_char when comparing clob to string on oracle, use execute audited

This commit is contained in:
Jörn Friedrich Dreyer 2013-06-24 16:12:21 +02:00
parent bca2eb39fa
commit 3e3b66bd0d
2 changed files with 6 additions and 2 deletions

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

View 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()) {