X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfixExtLinksProtocolRelative.php;h=97cd37e07e8d2dcd3db7667939ef2375f6b8a589;hb=7ddb8c2d62433a32aad4458cf0efb8b51f0467e2;hp=a44f8e5087d81e4aa94dbcc94baa228bb41b8da3;hpb=a7f35b785943ecf471095e79bc907aa5bbe228ca;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fixExtLinksProtocolRelative.php b/maintenance/fixExtLinksProtocolRelative.php index a44f8e5087..97cd37e07e 100644 --- a/maintenance/fixExtLinksProtocolRelative.php +++ b/maintenance/fixExtLinksProtocolRelative.php @@ -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,26 @@ 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__ ); }