Merge "Various fixes for phan-taint-check"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 16 Mar 2019 22:12:55 +0000 (22:12 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 16 Mar 2019 22:12:55 +0000 (22:12 +0000)
maintenance/includes/MigrateActors.php
maintenance/renameDbPrefix.php

index ba6c375..ef8756f 100644 (file)
@@ -144,6 +144,8 @@ class MigrateActors extends LoggedUpdateMaintenance {
 
        /**
         * Add actors for anons in a set of rows
+        *
+        * @suppress SecurityCheck-SQLInjection The array_keys/array_map is too much for static analysis
         * @param IDatabase $dbw
         * @param string $nameField
         * @param object[] &$rows
index 73bc4d9..e5aa23e 100644 (file)
@@ -82,7 +82,9 @@ class RenameDbPrefix extends Maintenance {
                                // $old should be regexp safe ([a-zA-Z_])
                                $newTable = preg_replace( '/^' . $old . '/', $new, $table );
                                $this->output( "Renaming table $table to $newTable\n" );
-                               $dbw->query( "RENAME TABLE $table TO $newTable" );
+                               $oldTableEnc = $dbw->addIdentifierQuotes( $table );
+                               $newTableEnc = $dbw->addIdentifierQuotes( $newTable );
+                               $dbw->query( "RENAME TABLE $oldTableEnc TO $newTableEnc" );
                        }
                        $count++;
                }