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