From: Aaron Schulz Date: Tue, 16 Feb 2016 21:42:34 +0000 (-0800) Subject: database: Add extra sanity check to selectFieldValues() X-Git-Tag: 1.31.0-rc.0~7918^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=ff23e83f41a917a954e70766449d34d5defa8e45;p=lhc%2Fweb%2Fwiklou.git database: Add extra sanity check to selectFieldValues() Change-Id: Ia2788ea84bd099550655930188365984e5274678 --- diff --git a/includes/db/Database.php b/includes/db/Database.php index ef4a7b74a2..98473a5f2a 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1069,7 +1069,9 @@ abstract class DatabaseBase implements IDatabase { $table, $var, $cond = '', $fname = __METHOD__, $options = array(), $join_conds = array() ) { 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 ) ) {