* respHeaders contains arrays for each header (should've been
respHeaders['content-length'][0] instead of respHeaders['content-length'])
using getResponseHeader() instead.
* This also fixes InstantCommons, which was broken by this (bug 36653).
* Also cleaned up a bit of w/s in foreign repo code while in the area.
Change-Id: I429b0a36618cc2b873077516e9c1023dc5b7d693
$this->setStatus();
if ( isset( $this->respHeaders['content-length'] ) ) {
- if ( strlen( $this->content ) < $this->respHeaders['content-length'] ) {
+ if ( strlen( $this->content ) < $this->getResponseHeader( 'content-length' ) ) {
$this->status->fatal( 'http-truncated-body' );
}
}
$query = array_merge( $query,
array(
- 'format' => 'json',
- 'action' => 'query',
+ 'format' => 'json',
+ 'action' => 'query',
'redirects' => 'true'
) );
if ( $this->mApiBase ) {
*/
static function newFromTitle( Title $title, $repo ) {
$data = $repo->fetchImageQuery( array(
- 'titles' => 'File:' . $title->getDBKey(),
- 'iiprop' => self::getProps(),
- 'prop' => 'imageinfo',
+ 'titles' => 'File:' . $title->getDBKey(),
+ 'iiprop' => self::getProps(),
+ 'prop' => 'imageinfo',
'iimetadataversion' => MediaHandler::getMetadataVersion()
) );