From: Brion Vibber Date: Mon, 13 Dec 2004 03:54:56 +0000 (+0000) Subject: Allow empty array in select() for the where conditions X-Git-Tag: 1.5.0alpha1~1095 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=1fd8260c2592ccd738b168ea84a83013693cde1c;p=lhc%2Fweb%2Fwiklou.git Allow empty array in select() for the where conditions --- diff --git a/includes/Database.php b/includes/Database.php index 70b8d7f80e..f42a2cf6a6 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -620,7 +620,7 @@ class Database { */ function select( $table, $vars, $conds='', $fname = 'Database::select', $options = array() ) { - if ( is_array( $vars ) ) { + if( is_array( $vars ) ) { $vars = implode( ',', $vars ); } if( is_array( $table ) ) { @@ -633,7 +633,7 @@ class Database { list( $useIndex, $tailOpts ) = $this->makeSelectOptions( $options ); - if ( $conds !== false && $conds != '' ) { + if( !empty( $conds ) ) { if ( is_array( $conds ) ) { $conds = $this->makeList( $conds, LIST_AND ); }