http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84430

Revision: 84430
Author:   reedy
Date:     2011-03-20 22:35:41 +0000 (Sun, 20 Mar 2011)
Log Message:
-----------
Followup r84392

Be a bit more explicit about the code, add a bit of readability into foreach too

Modified Paths:
--------------
    trunk/phase3/includes/api/ApiQueryBase.php

Modified: trunk/phase3/includes/api/ApiQueryBase.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryBase.php  2011-03-20 22:18:33 UTC (rev 
84429)
+++ trunk/phase3/includes/api/ApiQueryBase.php  2011-03-20 22:35:41 UTC (rev 
84430)
@@ -251,11 +251,19 @@
         * @return ResultWrapper
         */
        protected function select( $method, $extraQuery = array() ) {
+               $tables = $this->tables;
+               $fields = $this->fields;
+               $where = $this->where;
+               $options = $this->options;
+               $join_conds = $this->join_conds;
+
                // Merge $this->tables with $extraQuery['tables'], 
$this->fields with $extraQuery['fields'], etc.
                foreach ( array( 'tables', 'fields', 'where', 'options', 
'join_conds' ) as $var ) {
-                       $$var = array_merge( $this->{$var}, isset( 
$extraQuery[$var] ) ? (array)$extraQuery[$var] : array() );
+                       if ( isset( $extraQuery[$var] ) ) {
+                               $$var = array_merge( $$var, 
(array)$extraQuery[$var] );
+                       }
                }
-               
+
                // getDB has its own profileDBIn/Out calls
                $db = $this->getDB();
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to