r60819 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60818‎ | r60819 | r60820 >
Date:01:29, 8 January 2010
Author:robla
Status:deferred
Tags:
Comment:
followup to r60773. Renaming $wgCheckTitleFileExtensions to the now unused $wgCheckFileExtensions
Modified paths:
  • /branches/extensionless-files/includes/DefaultSettings.php (modified) (history)
  • /branches/extensionless-files/includes/Title.php (modified) (history)
  • /branches/extensionless-files/includes/upload/UploadBase.php (modified) (history)

Diff [purge]

Index: branches/extensionless-files/includes/Title.php
@@ -2671,14 +2671,14 @@
26722672 if( $this->getNamespace() == NS_FILE ) {
26732673 $file = wfLocalFile( $this );
26742674 if( $file->exists() ) {
2675 - global $wgCheckTitleFileExtensions;
 2675+ global $wgCheckFileExtensions;
26762676 if( $nt->getNamespace() != NS_FILE ) {
26772677 $errors[] = array('imagenocrossnamespace');
26782678 }
26792679 if( $nt->getText() != wfStripIllegalFilenameChars( $nt->getText() ) ) {
26802680 $errors[] = array('imageinvalidfilename');
26812681 }
2682 - if( $wgCheckTitleFileExtensions &&
 2682+ if( $wgCheckFileExtensions &&
26832683 !File::checkExtensionCompatibility( $file, $nt->getDBkey() ) ) {
26842684 $errors[] = array('imagetypemismatch');
26852685 }
Index: branches/extensionless-files/includes/DefaultSettings.php
@@ -2177,7 +2177,7 @@
21782178 * with file extensions of uploaded files (e.g if true, disallow a JPEG called
21792179 * "File:Foo", but allow "File:Foo.jpg").
21802180 */
2181 -$wgCheckTitleFileExtensions = true;
 2181+$wgCheckFileExtensions = true;
21822182
21832183 /**
21842184 * If this is turned off, users may override the warning for files not covered
Index: branches/extensionless-files/includes/upload/UploadBase.php
@@ -311,8 +311,8 @@
312312 $warnings['badfilename'] = $filename;
313313
314314 // Check whether the file extension is on the unwanted list
315 - global $wgCheckTitleFileExtensions, $wgFileExtensions;
316 - if ( $wgCheckTitleFileExtensions ) {
 315+ global $wgCheckFileExtensions, $wgFileExtensions;
 316+ if ( $wgCheckFileExtensions ) {
317317 if ( !$this->checkFileExtension( $this->mFinalExtension, $wgFileExtensions ) )
318318 $warnings['filetype-unwanted-type'] = array($this->mFinalExtension,
319319 implode(", ", $wgFileExtensions));
@@ -409,9 +409,9 @@
410410 }
411411
412412 /* Don't allow users to override the blacklist (check file extension) */
413 - global $wgCheckTitleFileExtensions, $wgStrictFileExtensions;
 413+ global $wgCheckFileExtensions, $wgStrictFileExtensions;
414414 global $wgFileExtensions, $wgFileBlacklist;
415 - if ( $wgCheckTitleFileExtensions ) {
 415+ if ( $wgCheckFileExtensions ) {
416416 if ( $this->mFinalExtension == '' ) {
417417 $this->mTitleError = self::FILETYPE_MISSING;
418418 return $this->mTitle = null;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60773Decouple page titles from MIME type, adding img_file_ext field to db (bug 4421robla07:15, 7 January 2010

Status & tagging log