Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251196

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/251196/1

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: newchange
Gerrit-Change-Id: Idb926097b6159c9c442ee6f427f1da60c5c5d2eb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

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

Reply via email to