Merge "Revert "Remove useless $out parameter from SkinTemplate::prepareQuickTemplate()""
[lhc/web/wiklou.git] / includes / filebackend / SwiftFileBackend.php
index 9249a09..f40ec46 100644 (file)
@@ -173,7 +173,7 @@ class SwiftFileBackend extends FileBackendStore {
         * Sanitize and filter the custom headers from a $params array.
         * We only allow certain Content- and X-Content- headers.
         *
-        * @param array $headers
+        * @param array $params
         * @return array Sanitized value of 'headers' field in $params
         */
        protected function sanitizeHdrs( array $params ) {
@@ -1066,10 +1066,11 @@ class SwiftFileBackend extends FileBackendStore {
                        list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $op['response'];
                        fclose( $op['stream'] ); // close open handle
                        if ( $rcode >= 200 && $rcode <= 299 ) {
+                               $size = $tmpFiles[$path] ? $tmpFiles[$path]->getSize() : 0;
                                // Double check that the disk is not full/broken
-                               if ( $tmpFiles[$path]->getSize() != $rhdrs['content-length'] ) {
+                               if ( $size != $rhdrs['content-length'] ) {
                                        $tmpFiles[$path] = null;
-                                       $rerr = "Got {$tmpFiles[$path]->getSize()}/{$rhdrs['content-length']} bytes";
+                                       $rerr = "Got {$size}/{$rhdrs['content-length']} bytes";
                                        $this->onError( null, __METHOD__,
                                                array( 'src' => $path ) + $ep, $rerr, $rcode, $rdesc );
                                }
@@ -1520,7 +1521,7 @@ class SwiftFileBackend extends FileBackendStore {
                                        'mtime' => $this->convertSwiftDate( $rhdrs['last-modified'], TS_MW ),
                                        // Empty objects actually return no content-length header in Ceph
                                        'size'  => isset( $rhdrs['content-length'] ) ? (int)$rhdrs['content-length'] : 0,
-                                       'sha1'  => $rhdrs[ 'x-object-meta-sha1base36'],
+                                       'sha1'  => $rhdrs['x-object-meta-sha1base36'],
                                        // Note: manifiest ETags are not an MD5 of the file
                                        'md5'   => ctype_xdigit( $rhdrs['etag'] ) ? $rhdrs['etag'] : null,
                                        'xattr' => array( 'metadata' => $metadata, 'headers' => $headers )
@@ -1790,7 +1791,7 @@ abstract class SwiftFileBackendList implements Iterator {
         *
         * @param string $container Resolved container name
         * @param string $dir Resolved path relative to container
-        * @param string $after null
+        * @param string $after
         * @param int $limit
         * @param array $params
         * @return Traversable|array