From f46cd2a593195953e9bd30694bd58486b0910bbe Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 15 Jan 2014 13:05:01 -0800 Subject: [PATCH] Fixed wrong usage of $tmpFile in Swift backend Change-Id: I21293be38c53b4dca3030c26a201f70d8ed243f3 --- includes/filebackend/SwiftFileBackend.php | 2 +- tests/phpunit/includes/filebackend/FileBackendTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 9ed6a4581f..17b9b4d866 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -1101,7 +1101,7 @@ class SwiftFileBackend extends FileBackendStore { fclose( $op['stream'] ); // close open handle if ( $rcode >= 200 && $rcode <= 299 // double check that the disk is not full/broken - && $tmpFile->getSize() == $rhdrs['content-length'] + && $tmpFiles[$path]->getSize() == $rhdrs['content-length'] ) { // good } elseif ( $rcode === 404 ) { diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index 1dbc74ca1b..cee2da2f4f 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -1324,7 +1324,7 @@ class FileBackendTest extends MediaWikiTestCase { $cases[] = array( array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) + array( "contents xx $", "contents xy 111", "contents xz" ) ); return $cases; @@ -1391,7 +1391,7 @@ class FileBackendTest extends MediaWikiTestCase { $cases[] = array( array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) + array( "contents xx 1111", "contents xy %", "contents xz $" ) ); return $cases; -- 2.20.1