summaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-09-02 13:58:01 +0200
committerRobin Appelman <icewind@owncloud.com>2012-09-02 13:58:01 +0200
commit3c784ede830974a6816f5d971d6e14305c34c0c9 (patch)
treed8829971f1573224d1e5d6cbc1ac30885ca8ccc1 /lib/db.php
parent2bb7cb9f64b0244290ce8df745fdb040823dbd62 (diff)
downloadnextcloud-server-3c784ede830974a6816f5d971d6e14305c34c0c9.tar.gz
nextcloud-server-3c784ede830974a6816f5d971d6e14305c34c0c9.zip
use str_ireplace instead of duplicate str_replace
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/db.php b/lib/db.php
index 1979b82f8cc..16b39208735 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -533,18 +533,14 @@ class OC_DB {
// differences in escaping of table names ('`' for mysql) and getting the current timestamp
if( $type == 'sqlite' || $type == 'sqlite3' ){
$query = str_replace( '`', '"', $query );
- $query = str_replace( 'NOW()', 'datetime(\'now\')', $query );
- $query = str_replace( 'now()', 'datetime(\'now\')', $query );
- $query = str_replace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $query );
- $query = str_replace( 'unix_timestamp()', 'strftime(\'%s\',\'now\')', $query );
+ $query = str_ireplace( 'NOW()', 'datetime(\'now\')', $query );
+ $query = str_ireplace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $query );
}elseif( $type == 'pgsql' ){
$query = str_replace( '`', '"', $query );
- $query = str_replace( 'UNIX_TIMESTAMP()', 'cast(extract(epoch from current_timestamp) as integer)', $query );
- $query = str_replace( 'unix_timestamp()', 'cast(extract(epoch from current_timestamp) as integer)', $query );
+ $query = str_ireplace( 'UNIX_TIMESTAMP()', 'cast(extract(epoch from current_timestamp) as integer)', $query );
}elseif( $type == 'oci' ){
$query = str_replace( '`', '"', $query );
- $query = str_replace( 'NOW()', 'CURRENT_TIMESTAMP', $query );
- $query = str_replace( 'now()', 'CURRENT_TIMESTAMP', $query );
+ $query = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $query );
}
// replace table name prefix