jenkins-bot has submitted this change and it was merged.

Change subject: Make FindOrphanedFiles handle bad file titles
......................................................................


Make FindOrphanedFiles handle bad file titles

Change-Id: Idb926097b6159c9c442ee6f427f1da60c5c5d2eb
---
M maintenance/findOrphanedFiles.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Gilles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index a1e274c..41650bd 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -136,7 +136,11 @@
                foreach ( array_diff( $curNames, $curNamesFound ) as $name ) {
                        $file = $repo->newFile( $name );
                        // Print name and public URL to ease recovery
-                       $this->output( $name . "\n" . $file->getCanonicalUrl() 
. "\n\n" );
+                       if ( $file ) {
+                               $this->output( $name . "\n" . 
$file->getCanonicalUrl() . "\n\n" );
+                       } else {
+                               $this->error( "Cannot get URL for bad file 
title '$name'" );
+                       }
                }
 
                foreach ( array_diff( $oldNames, $oldNamesFound ) as $name ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/251196
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb926097b6159c9c442ee6f427f1da60c5c5d2eb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to