fix now() function for sqlite3

This commit is contained in:
Robin Appelman 2011-10-17 00:24:42 +02:00
parent 330c513015
commit 77378fa189
1 changed files with 1 additions and 1 deletions

View File

@ -350,7 +350,7 @@ class OC_DB {
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); $prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
// differences in escaping of table names ('`' for mysql) and getting the current timestamp // differences in escaping of table names ('`' for mysql) and getting the current timestamp
if( $type == 'sqlite' ){ if( $type == 'sqlite' || $type == 'sqlite3' ){
$query = str_replace( '`', '\'', $query ); $query = str_replace( '`', '\'', $query );
$query = str_replace( 'NOW()', 'datetime(\'now\')', $query ); $query = str_replace( 'NOW()', 'datetime(\'now\')', $query );
$query = str_replace( 'now()', 'datetime(\'now\')', $query ); $query = str_replace( 'now()', 'datetime(\'now\')', $query );