Merge "Re add wpScrolltop id in EditPage"
[lhc/web/wiklou.git] / maintenance / fixExtLinksProtocolRelative.php
index a44f8e5..0fae63c 100644 (file)
@@ -34,8 +34,8 @@ require_once __DIR__ . '/Maintenance.php';
 class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription =
-                       "Fixes any entries in the externallinks table containing protocol-relative URLs";
+               $this->addDescription(
+                       'Fixes any entries in the externallinks table containing protocol-relative URLs' );
        }
 
        protected function getUpdateKey() {
@@ -54,8 +54,8 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
                        return false;
                }
                $this->output( "Fixing protocol-relative entries in the externallinks table...\n" );
-               $res = $db->select( 'externallinks', array( 'el_from', 'el_to', 'el_index' ),
-                       array( 'el_index' . $db->buildLike( '//', $db->anyString() ) ),
+               $res = $db->select( 'externallinks', [ 'el_from', 'el_to', 'el_index' ],
+                       [ 'el_index' . $db->buildLike( '//', $db->anyString() ) ],
                        __METHOD__
                );
                $count = 0;
@@ -66,28 +66,28 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
                                wfWaitForSlaves();
                        }
                        $db->insert( 'externallinks',
-                               array(
-                                       array(
+                               [
+                                       [
                                                'el_id' => $db->nextSequenceValue( 'externallinks_el_id_seq' ),
                                                'el_from' => $row->el_from,
                                                'el_to' => $row->el_to,
                                                'el_index' => "http:{$row->el_index}",
-                                       ),
-                                       array(
+                                       ],
+                                       [
                                                'el_id' => $db->nextSequenceValue( 'externallinks_el_id_seq' ),
                                                'el_from' => $row->el_from,
                                                'el_to' => $row->el_to,
                                                'el_index' => "https:{$row->el_index}",
-                                       )
-                               ), __METHOD__, array( 'IGNORE' )
+                                       ]
+                               ], __METHOD__, [ 'IGNORE' ]
                        );
                        $db->delete(
                                'externallinks',
-                               array(
+                               [
                                        'el_index' => $row->el_index,
                                        'el_from' => $row->el_from,
                                        'el_to' => $row->el_to
-                               ),
+                               ],
                                __METHOD__
                        );
                }