From: jenkins-bot Date: Thu, 18 Feb 2016 14:46:29 +0000 (+0000) Subject: Merge "database: Add extra sanity check to selectFieldValues()" X-Git-Tag: 1.31.0-rc.0~7918 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=d42754e47722436ef52218f21a8e544a05ee9ad7;p=lhc%2Fweb%2Fwiklou.git Merge "database: Add extra sanity check to selectFieldValues()" --- d42754e47722436ef52218f21a8e544a05ee9ad7 diff --cc includes/db/Database.php index d741b2f37b,98473a5f2a..351d43845a --- a/includes/db/Database.php +++ b/includes/db/Database.php @@@ -1066,10 -1066,12 +1066,12 @@@ abstract class DatabaseBase implements } public function selectFieldValues( - $table, $var, $cond = '', $fname = __METHOD__, $options = array(), $join_conds = array() + $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = [] ) { if ( $var === '*' ) { // sanity - throw new DBUnexpectedError( $this, "Cannot use a * field: got '$var'" ); + throw new DBUnexpectedError( $this, "Cannot use a * field" ); + } elseif ( !is_string( $var ) ) { // sanity + throw new DBUnexpectedError( $this, "Cannot use an array of fields" ); } if ( !is_array( $options ) ) {