Merge "Only pass strings to mysqli::real_escape_string"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 10 Feb 2014 19:17:47 +0000 (19:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 10 Feb 2014 19:17:47 +0000 (19:17 +0000)
1  2 
includes/db/DatabaseMysqli.php

@@@ -244,7 -244,6 +244,7 @@@ class DatabaseMysqli extends DatabaseMy
         */
        protected function mysqlFieldType( $res, $n ) {
                $field = $res->fetch_field_direct( $n );
 +
                return $field->type;
        }
  
         * @return string
         */
        protected function mysqlRealEscapeString( $s ) {
+               if ( is_integer( $s ) ) {
+                       // HHVM fatals passing numbers to real_escape_string
+                       $s = (string) $s;
+               }
                return $this->mConn->real_escape_string( $s );
        }