From: Aaron Schulz Date: Sat, 28 Jul 2012 17:38:25 +0000 (-0700) Subject: [FileBackend] Skip over some illegal paths and output the error. X-Git-Tag: 1.31.0-rc.0~22884^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=a649bfb419709113d5127909c6e6b810be917e9c;p=lhc%2Fweb%2Fwiklou.git [FileBackend] Skip over some illegal paths and output the error. Change-Id: Ib32aadc6398168e4a63279d7da61a0dd1e1a6483 --- 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