dont double escape

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/3089/head
Robin Appelman 8 years ago
parent 07449a4885
commit 3355fd549f
No known key found for this signature in database
GPG Key ID: 50F2B59C6DEBBCFE
  1. 1
      lib/private/DB/AdapterOCI8.php
  2. 1
      lib/private/DB/AdapterSqlite.php

@ -41,7 +41,6 @@ class AdapterOCI8 extends Adapter {
const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400"; const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400";
public function fixupStatement($statement) { public function fixupStatement($statement) {
$statement = preg_replace('( LIKE \?)', '$0 ESCAPE \'\\\'', $statement);
$statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement); $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement);
$statement = str_replace('`', '"', $statement); $statement = str_replace('`', '"', $statement);
$statement = str_ireplace('NOW()', 'CURRENT_TIMESTAMP', $statement); $statement = str_ireplace('NOW()', 'CURRENT_TIMESTAMP', $statement);

@ -41,7 +41,6 @@ class AdapterSqlite extends Adapter {
} }
public function fixupStatement($statement) { public function fixupStatement($statement) {
$statement = preg_replace('( I?LIKE \?)', '$0 ESCAPE \'\\\'', $statement);
$statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement); $statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement);
$statement = str_replace( '`', '"', $statement ); $statement = str_replace( '`', '"', $statement );
$statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement ); $statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement );

Loading…
Cancel
Save