* Per page edit-notices now work in namespaces without subpages enabled.
* (bug 30245) Use the correct way to construct a log page title
* (bug 31081) $wgEnotifUseJobQ causes many unnecessary jobs to be queued
+* (bug 30202) File names are now restricted on upload to 240 bytes, because of
+ restrictions on some of the database fields.
=== API changes in 1.19 ===
* (bug 19838) siprop=interwikimap can now use the interwiki cache.
}
$this->mFilteredName = $nt->getDBkey();
+ # oi_archive_name is max 255 bytes, which include a timestamp and an
+ # exclamation mark, so restrict file name to 240 bytes. Return
+ # ILLEGAL_FILENAME, just like would have happened for >255 bytes
+ if ( strlen( $this->mFilteredName ) > 240 ) {
+ $this->mTitleError = self::ILLEGAL_FILENAME;
+ return $this->mTitle = null;
+ }
+
/**
* We'll want to blacklist against *any* 'extension', and use
* only the final one for the whitelist.
$this->assertUploadTitleAndCode( '.jpg',
null, UploadBase::MIN_LENGTH_PARTNAME,
'upload title without basename' );
+
+ /* A title that is longer than 255 bytes */
+ $this->assertUploadTitleAndCode( str_repeat( 'a', 255 ) . '.jpg',
+ null, UploadBase::ILLEGAL_FILENAME,
+ 'upload title longer than 255 bytes' );
+
+ /* A title that is longer than 240 bytes */
+ $this->assertUploadTitleAndCode( str_repeat( 'a', 240 ) . '.jpg',
+ null, UploadBase::ILLEGAL_FILENAME,
+ 'upload title longer than 240 bytes' );
}
/**
public function testTitleValidation( $name ) {
$this->mTitle = false;
$this->mDesiredDestName = $name;
+ $this->mTitleError = UploadBase::OK;
$this->getTitle();
return $this->mTitleError;
}