X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfixExtLinksProtocolRelative.php;h=0c60e62c702e2477ff55fae64634e1bb38a4eecd;hb=64717f414cdd66a27630b92539cde5456d622141;hp=02d65ed15445765ab733479982620764316f3209;hpb=a33048bb8b4a1c7717c0760acd03563bf937687d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fixExtLinksProtocolRelative.php b/maintenance/fixExtLinksProtocolRelative.php index 02d65ed154..0c60e62c70 100644 --- a/maintenance/fixExtLinksProtocolRelative.php +++ b/maintenance/fixExtLinksProtocolRelative.php @@ -34,7 +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->mDescription = + "Fixes any entries in the externallinks table containing protocol-relative URLs"; } protected function getUpdateKey() { @@ -49,6 +50,7 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance { $db = wfGetDB( DB_MASTER ); if ( !$db->tableExists( 'externallinks' ) ) { $this->error( "externallinks table does not exist" ); + return false; } $this->output( "Fixing protocol-relative entries in the externallinks table...\n" ); @@ -79,9 +81,18 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance { ) ), __METHOD__, array( 'IGNORE' ) ); - $db->delete( 'externallinks', array( 'el_index' => $row->el_index, 'el_from' => $row->el_from, 'el_to' => $row->el_to ), __METHOD__ ); + $db->delete( + 'externallinks', + array( + 'el_index' => $row->el_index, + 'el_from' => $row->el_from, + 'el_to' => $row->el_to + ), + __METHOD__ + ); } $this->output( "Done, $count rows updated.\n" ); + return true; } }