From a649bfb419709113d5127909c6e6b810be917e9c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 28 Jul 2012 10:38:25 -0700 Subject: [PATCH] [FileBackend] Skip over some illegal paths and output the error. Change-Id: Ib32aadc6398168e4a63279d7da61a0dd1e1a6483 --- maintenance/copyFileBackend.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 498bc6b00b..70a923262e 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -140,6 +140,12 @@ class CopyFileBackend extends Maintenance { $fsFile = $src->getLocalReference( array( 'src' => $srcPath, 'latest' => 1 ) ); if ( !$fsFile ) { $this->error( "Could not get local copy of $srcPath.", 1 ); // die + } elseif ( !$fsFile->exists() ) { + // FSFileBackends just return the path for getLocalReference() and paths with + // illegal slashes may get normalized to a different path. This can cause the + // local reference to not exist...skip these broken files. + $this->error( "Detected possible illegal path for $srcPath." ); + continue; } $fsFiles[] = $fsFile; // keep TempFSFile objects alive as needed // Note: prepare() is usually fast for key/value backends -- 2.20.1