* 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 ) {
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 );
}
'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 )
*
* @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