MediaWiki  REL1_19
UploadBase Class Reference

UploadBase and subclasses are the backend of MediaWiki's file uploads. More...

Inheritance diagram for UploadBase:

List of all members.

Public Member Functions

 __construct ()
 checkSvgScriptCallback ($element, $attribs, $data=null)
 checkWarnings ()
 Check for non fatal problems with the file.
 cleanupTempFile ()
 If we've modified the upload file we need to manually remove it on exit to clean up.
 convertVerifyErrorToStatus ($error)
 fetchFile ()
 Fetch the file.
 getFileSize ()
 Return the file size.
 getImageInfo ($result)
 Gets image info about the file just uploaded.
 getLocalFile ()
 Return the local file and initializes if necessary.
 getRealPath ($srcPath)
 getSourceType ()
 Returns the upload type.
 getTempPath ()
 getTitle ()
 Returns the title of the file to be uploaded.
 getVerificationErrorCode ($error)
 initializeFromRequest (&$request)
 Initialize from a WebRequest.
 initializePathInfo ($name, $tempPath, $fileSize, $removeTempFile=false)
 Initialize the path information.
 isEmptyFile ()
 Return true if the file is empty.
 performUpload ($comment, $pageText, $watch, $user)
 Really perform the upload.
 stashFile ()
 If the user does not supply all necessary information in the first upload form submission (either by accident or by design) then we may want to stash the file temporarily, get more information, and publish the file later.
 stashFileGetKey ()
 Stash a file in a temporary directory, returning a key which can be used to find the file again.
 stashSession ()
 alias for stashFileGetKey, for backwards compatibility
 verifyPermissions ($user)
 Alias for verifyTitlePermissions.
 verifyTitlePermissions ($user)
 Check whether the user can edit, upload and create the image.
 verifyUpload ()
 Verify whether the upload is sane.
 zipEntryCallback ($entry)
 Callback for ZipDirectoryReader to detect Java class files.

Static Public Member Functions

static checkFileExtension ($ext, $list)
 Perform case-insensitive match against a list of file extensions.
static checkFileExtensionList ($ext, $list)
 Perform case-insensitive match against a list of file extensions.
static checkSvgPICallback ($target, $data)
 Callback to filter SVG Processing Instructions.
static checkXMLEncodingMissmatch ($file)
 Check a whitelist of xml encodings that are known not to be interpreted differently by the server's xml parser (expat) and some common browsers.
static createFromRequest (&$request, $type=null)
 Create a form of UploadBase depending on wpSourceType and initializes it.
static detectScript ($file, $mime, $extension)
 Heuristic for detecting files that *could* contain JavaScript instructions or things that may look like HTML to a browser and are thus potentially harmful.
static detectVirus ($file)
 Generic wrapper function for a virus scanner program.
static getExistsWarning ($file)
 Helper function that does various existence checks for a file.
static getFilenamePrefixBlacklist ()
 Get a list of blacklisted filename prefixes from [[MediaWiki:Filename-prefix-blacklist]].
static getMaxUploadSize ($forType=null)
static isAllowed ($user)
 Returns true if the user can use this upload module or else a string identifying the missing permission.
static isEnabled ()
 Returns true if uploads are enabled.
static isThumbName ($filename)
 Helper function that checks whether the filename looks like a thumbnail.
static isValidRequest ($request)
 Check whether a request if valid for this handler.
static splitExtensions ($filename)
 Split a file into a base name and all dot-delimited 'extensions' on the end.
static userCanReUpload (User $user, $img)
 Check if a user is the last uploader.
static verifyExtension ($mime, $extension)
 Checks if the mime type of the uploaded file matches the file extension.

Public Attributes

 $mDestName
 $mFileProps
 $mFileSize
 $mFinalExtension
 $mRemoveTempFile
 $mSourceType
 $mSVGNSError
 $mTitleError = 0
const EMPTY_FILE = 3
const FILE_TOO_LARGE = 12
const FILENAME_TOO_LONG = 14
const FILETYPE_BADTYPE = 9
const FILETYPE_MISSING = 8
const HOOK_ABORTED = 11
const ILLEGAL_FILENAME = 5
const MIN_LENGTH_PARTNAME = 4
const OK = 0
const OVERWRITE_EXISTING_FILE = 7
const SUCCESS = 0
const UPLOAD_VERIFICATION_ERROR = 11
const VERIFICATION_ERROR = 10
const WINDOWS_NONASCII_FILENAME = 13

Static Public Attributes

static $uploadHandlers = array( 'Stash', 'File', 'Url' )

Protected Member Functions

 detectScriptInSvg ($filename)
 saveTempUploadedFile ($saveName, $tempSrc)
 NOTE: Probably should be deprecated in favor of UploadStash, but this is sometimes called outside that context.
 validateName ()
 Verify that the name is valid and, if necessary, that we can overwrite.
 verifyFile ()
 Verifies that it's ok to include the uploaded file.
 verifyMimeType ($mime)
 Verify the mime type.
 verifyPartialFile ()
 A verification routine suitable for partial files.

Protected Attributes

 $mBlackListedExtensions
 $mDesiredDestName
 $mFilteredName
 $mJavaDetected
 $mLocalFile
 $mTempPath
 $mTitle = false

Static Protected Attributes

static $safeXmlEncodings = array( 'UTF-8', 'ISO-8859-1', 'ISO-8859-2', 'UTF-16', 'UTF-32' )

Private Member Functions

 checkOverwrite ($user)
 Check if there's an overwrite conflict and, if so, if restrictions forbid this user from performing the upload.
 stripXmlNamespace ($name)

Static Private Member Functions

static checkCssFragment ($value)
 Check a block of CSS or CSS fragment for anything that looks like it is bringing in remote code.
static splitXmlNamespace ($element)
 Divide the element name passed by the xml parser to the callback into URI and prifix.

Detailed Description

UploadBase and subclasses are the backend of MediaWiki's file uploads.

The frontends are formed by ApiUpload and SpecialUpload.

See also includes/docs/upload.txt

Author:
Brion Vibber
Bryan Tong Minh
Michael Dale

Definition at line 18 of file UploadBase.php.


Constructor & Destructor Documentation

Definition at line 150 of file UploadBase.php.


Member Function Documentation

static UploadBase::checkCssFragment ( value) [static, private]

Check a block of CSS or CSS fragment for anything that looks like it is bringing in remote code.

Parameters:
string$valuea string of CSS
bool$propOnlyonly check css properties (start regex with :)
Returns:
bool true if the CSS contains an illegal string, false if otherwise

Definition at line 1300 of file UploadBase.php.

References $matches.

static UploadBase::checkFileExtension ( ext,
list 
) [static]

Perform case-insensitive match against a list of file extensions.

Returns true if the extension is in the list.

Parameters:
$extString
$listArray
Returns:
Boolean

Definition at line 841 of file UploadBase.php.

References $ext.

Referenced by checkWarnings(), and verifyMimeType().

Here is the caller graph for this function:

static UploadBase::checkFileExtensionList ( ext,
list 
) [static]

Perform case-insensitive match against a list of file extensions.

Returns an array of matching extensions.

Parameters:
$extArray
$listArray
Returns:
Boolean

Definition at line 853 of file UploadBase.php.

References $ext.

Referenced by StreamFile\contentTypeFromPath(), and getTitle().

Here is the caller graph for this function:

UploadBase::checkOverwrite ( user) [private]

Check if there's an overwrite conflict and, if so, if restrictions forbid this user from performing the upload.

Parameters:
$userUser
Returns:
mixed true on success, array on failure

Definition at line 1481 of file UploadBase.php.

Referenced by verifyTitlePermissions().

Here is the caller graph for this function:

static UploadBase::checkSvgPICallback ( target,
data 
) [static]

Callback to filter SVG Processing Instructions.

Parameters:
$targetstring processing instruction name
$datastring processing instruction attribute and value
Returns:
bool (true if the filter identified something bad)

Definition at line 1364 of file UploadBase.php.

UploadBase::checkSvgScriptCallback ( element,
attribs,
data = null 
)
Todo:
Replace this with a whitelist filter!

Definition at line 1106 of file UploadBase.php.

References Sanitizer\normalizeCss(), splitXmlNamespace(), stripXmlNamespace(), and wfDebug().

Here is the call graph for this function:

Check for non fatal problems with the file.

Returns:
Array of warnings

Reimplemented in UploadFromUrl.

Definition at line 526 of file UploadBase.php.

References $title, $wgCheckFileExtensions, $wgFileExtensions, $wgLang, $wgUploadSizeWarning, Title\capitalize(), checkFileExtension(), getExistsWarning(), getLocalFile(), FSFile\getSha1Base36FromPath(), getTitle(), and RepoGroup\singleton().

Here is the call graph for this function:

static UploadBase::checkXMLEncodingMissmatch ( file) [static]

Check a whitelist of xml encodings that are known not to be interpreted differently by the server's xml parser (expat) and some common browsers.

Parameters:
string$filepathname to the temporary upload file
Returns:
Boolean: true if the file contains an encoding that could be misinterpreted

Definition at line 1055 of file UploadBase.php.

References $file, $matches, $wgSVGMetadataCutoff, wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().

Here is the call graph for this function:

If we've modified the upload file we need to manually remove it on exit to clean up.

Definition at line 808 of file UploadBase.php.

References wfDebug().

Here is the call graph for this function:

Definition at line 1678 of file UploadBase.php.

References getVerificationErrorCode(), and Status\newFatal().

Here is the call graph for this function:

static UploadBase::createFromRequest ( &$  request,
type = null 
) [static]

Create a form of UploadBase depending on wpSourceType and initializes it.

Parameters:
$requestWebRequest
$type

Definition at line 106 of file UploadBase.php.

References wfDebug(), and wfRunHooks().

Referenced by SpecialUpload\loadRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

static UploadBase::detectScript ( file,
mime,
extension 
) [static]

Heuristic for detecting files that *could* contain JavaScript instructions or things that may look like HTML to a browser and are thus potentially harmful.

The present implementation will produce false positives in some situations.

Parameters:
$fileString: pathname to the temporary upload file
$mimeString: the mime type of the file
$extensionString: the extension of the file
Returns:
Boolean: true if the file contains something looking like embedded scripts

Definition at line 906 of file UploadBase.php.

References $file, $mime, $wgAllowTitlesInSVG, Sanitizer\decodeCharReferences(), wfDebug(), and wfProfileOut().

Here is the call graph for this function:

UploadBase::detectScriptInSvg ( filename) [protected]
Parameters:
$filenamestring
Returns:
mixed false of the file is verified (does not contain scripts), array otherwise.

Definition at line 1028 of file UploadBase.php.

Referenced by verifyPartialFile().

Here is the caller graph for this function:

static UploadBase::detectVirus ( file) [static]

Generic wrapper function for a virus scanner program.

This relies on the $wgAntivirus and $wgAntivirusSetup variables. $wgAntivirusRequired may be used to deny upload if the scan fails.

Parameters:
$fileString: pathname to the temporary upload file
Returns:
mixed false if not virus is found, NULL if the scan fails or is disabled, or a string containing feedback from the virus scanner if a virus was found. If textual feedback is missing but a virus was found, this function returns true.

Definition at line 1388 of file UploadBase.php.

References $command, $file, $output, $wgAntivirus, $wgAntivirusRequired, $wgAntivirusSetup, $wgOut, wfDebug(), wfEscapeShellArg(), wfMsg(), and wfShellExec().

Referenced by verifyPartialFile().

Here is the call graph for this function:

Here is the caller graph for this function:

Fetch the file.

Usually a no-op

Reimplemented in UploadFromUrl.

Definition at line 186 of file UploadBase.php.

References Status\newGood().

Here is the call graph for this function:

static UploadBase::getExistsWarning ( file) [static]

Helper function that does various existence checks for a file.

The following checks are performed:

  • The file exists
  • Article with the same name as the file exists
  • File exists with normalized extension
  • The file looks like a thumbnail and the original exists
Parameters:
$fileFile The File object to check
Returns:
mixed False if the file does not exists, else an array

Definition at line 1538 of file UploadBase.php.

Referenced by checkWarnings().

Here is the caller graph for this function:

Get a list of blacklisted filename prefixes from [[MediaWiki:Filename-prefix-blacklist]].

Returns:
array list of prefixes

Definition at line 1631 of file UploadBase.php.

References $comment, $lines, and wfMessage().

Here is the call graph for this function:

Return the file size.

Returns:
integer

Definition at line 202 of file UploadBase.php.

UploadBase::getImageInfo ( result)

Gets image info about the file just uploaded.

Also has the effect of setting metadata to be an 'indexed tag name' in returned API result if 'metadata' was requested. Oddly, we have to pass the "result" object down just so it can do that with the appropriate format, presumably.

Parameters:
$resultApiResult:
Returns:
Array: image info

Definition at line 1663 of file UploadBase.php.

References $file, $result, ApiQueryImageInfo\getInfo(), getLocalFile(), and ApiQueryImageInfo\getPropertyNames().

Here is the call graph for this function:

Return the local file and initializes if necessary.

Returns:
LocalFile

Definition at line 739 of file UploadBase.php.

References getTitle(), and wfLocalFile().

Referenced by checkWarnings(), getImageInfo(), performUpload(), and validateName().

Here is the call graph for this function:

Here is the caller graph for this function:

static UploadBase::getMaxUploadSize ( forType = null) [static]

Definition at line 1684 of file UploadBase.php.

References $wgMaxUploadSize.

Referenced by UploadFromChunks\addChunk(), UploadForm\addUploadJS(), UploadForm\getSourceSection(), and verifyUpload().

Here is the caller graph for this function:

UploadBase::getRealPath ( srcPath)
Parameters:
$srcPathString: the source path
Returns:
the real path if it was a virtual URL

Definition at line 210 of file UploadBase.php.

References RepoGroup\singleton().

Referenced by UploadFromChunks\continueChunks(), and UploadFromStash\initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the upload type.

Should be overridden by child classes

Since:
1.18
Returns:
string

Reimplemented in UploadFromStash, UploadFromUrl, and UploadFromFile.

Definition at line 158 of file UploadBase.php.

Referenced by stashFile(), and verifyUpload().

Here is the caller graph for this function:

Definition at line 815 of file UploadBase.php.

Returns the title of the file to be uploaded.

Sets mTitleError in case the name was illegal.

Returns:
Title The title of the file or null in case the name was illegal

Definition at line 627 of file UploadBase.php.

References $ext, $mime, $title, $wgCheckFileExtensions, $wgFileBlacklist, $wgFileExtensions, $wgStrictFileExtensions, checkFileExtensionList(), FILENAME_TOO_LONG, FILETYPE_BADTYPE, FILETYPE_MISSING, ILLEGAL_FILENAME, Title\makeTitleSafe(), MIN_LENGTH_PARTNAME, Title\newFromText(), MimeMagic\singleton(), splitExtensions(), wfIsWindows(), wfStripIllegalFilenameChars(), and WINDOWS_NONASCII_FILENAME.

Referenced by checkWarnings(), getLocalFile(), UploadFromUrl\insertJob(), performUpload(), UploadTestHandler\testTitleValidation(), validateName(), verifyPartialFile(), and verifyTitlePermissions().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 46 of file UploadBase.php.

Referenced by UploadFromChunks\concatenateChunks(), and convertVerifyErrorToStatus().

Here is the caller graph for this function:

UploadBase::initializeFromRequest ( &$  request) [abstract]

Initialize from a WebRequest.

Override this in a subclass.

Reimplemented in UploadTestHandler, UploadFromStash, UploadFromUrl, and UploadFromFile.

UploadBase::initializePathInfo ( name,
tempPath,
fileSize,
removeTempFile = false 
)

Initialize the path information.

Parameters:
$namestring the desired destination name
$tempPathstring the temporary path
$fileSizeint the file size
$removeTempFilebool (false) remove the temporary file?
Returns:
null

Definition at line 168 of file UploadBase.php.

References FileBackend\isStoragePath().

Referenced by UploadFromChunks\continueChunks(), UploadFromFile\initialize(), UploadFromUrl\initialize(), and UploadFromStash\initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

static UploadBase::isAllowed ( user) [static]

Returns true if the user can use this upload module or else a string identifying the missing permission.

Can be overriden by subclasses.

Parameters:
$userUser

Reimplemented in UploadFromUrl.

Definition at line 88 of file UploadBase.php.

References $user.

Referenced by SkinTemplate\buildNavUrls(), SpecialUpload\execute(), StandardTemplate\quickBar(), CologneBlueTemplate\quickBar(), and NostalgiaTemplate\topLinks().

Here is the caller graph for this function:

Return true if the file is empty.

Returns:
bool

Definition at line 194 of file UploadBase.php.

Referenced by UploadFromFile\verifyUpload(), and verifyUpload().

Here is the caller graph for this function:

static UploadBase::isEnabled ( ) [static]

Returns true if uploads are enabled.

Can be override by subclasses.

Reimplemented in UploadFromUrl.

Definition at line 70 of file UploadBase.php.

References $wgEnableUploads, wfIniGetBool(), and wfIsHipHop().

Referenced by SkinTemplate\buildNavUrls(), ApiUpload\execute(), SpecialUpload\execute(), StandardTemplate\quickBar(), CologneBlueTemplate\quickBar(), NostalgiaTemplate\topLinks(), and SpecialUpload\userCanExecute().

Here is the call graph for this function:

Here is the caller graph for this function:

static UploadBase::isThumbName ( filename) [static]

Helper function that checks whether the filename looks like a thumbnail.

Definition at line 1616 of file UploadBase.php.

References $n.

static UploadBase::isValidRequest ( request) [static]

Check whether a request if valid for this handler.

Reimplemented in UploadFromUrl, UploadFromStash, and UploadFromFile.

Definition at line 146 of file UploadBase.php.

UploadBase::performUpload ( comment,
pageText,
watch,
user 
)

Really perform the upload.

Stores the file in the local repo, watches if necessary and runs the UploadComplete hook.

Parameters:
$userUser
Returns:
Status indicating the whether the upload succeeded.

Reimplemented in UploadFromUrl, UploadFromStash, and UploadFromChunks.

Definition at line 599 of file UploadBase.php.

References $comment, $user, File\DELETE_SOURCE, getLocalFile(), getTitle(), and wfRunHooks().

Here is the call graph for this function:

UploadBase::saveTempUploadedFile ( saveName,
tempSrc 
) [protected]

NOTE: Probably should be deprecated in favor of UploadStash, but this is sometimes called outside that context.

Stash a file in a temporary directory for later processing after the user has confirmed it.

If the user doesn't explicitly cancel or accept, these files can accumulate in the temp directory.

Parameters:
$saveNameString: the destination filename
$tempSrcString: the source temporary file to save
Returns:
String: full path the stashed file, or false on failure

Definition at line 761 of file UploadBase.php.

References RepoGroup\singleton().

Here is the call graph for this function:

static UploadBase::splitExtensions ( filename) [static]

Split a file into a base name and all dot-delimited 'extensions' on the end.

Some web server configurations will fall back to earlier pseudo-'extensions' to determine type and execute scripts, so the blacklist needs to check them all.

Returns:
array

Definition at line 827 of file UploadBase.php.

Referenced by StreamFile\contentTypeFromPath(), and getTitle().

Here is the caller graph for this function:

static UploadBase::splitXmlNamespace ( element) [static, private]

Divide the element name passed by the xml parser to the callback into URI and prifix.

Parameters:
$namestring
Returns:
array containing the namespace URI and prefix

Definition at line 1350 of file UploadBase.php.

Referenced by checkSvgScriptCallback().

Here is the caller graph for this function:

If the user does not supply all necessary information in the first upload form submission (either by accident or by design) then we may want to stash the file temporarily, get more information, and publish the file later.

This method will stash a file in a temporary directory for later processing, and save the necessary descriptive info into the database. This method returns the file object, which also has a 'fileKey' property which can be passed through a form or API request to find this stashed file again.

Returns:
UploadStashFile stashed file

Reimplemented in UploadFromStash, and UploadFromChunks.

Definition at line 778 of file UploadBase.php.

References $file, getSourceType(), and RepoGroup\singleton().

Referenced by stashFileGetKey().

Here is the call graph for this function:

Here is the caller graph for this function:

Stash a file in a temporary directory, returning a key which can be used to find the file again.

See stashFile().

Returns:
String: file key

Definition at line 791 of file UploadBase.php.

References stashFile().

Referenced by stashSession().

Here is the call graph for this function:

Here is the caller graph for this function:

alias for stashFileGetKey, for backwards compatibility

Returns:
String: file key

Reimplemented in UploadFromStash.

Definition at line 800 of file UploadBase.php.

References stashFileGetKey().

Referenced by UploadFromUrl\insertJob().

Here is the call graph for this function:

Here is the caller graph for this function:

UploadBase::stripXmlNamespace ( name) [private]

Definition at line 1372 of file UploadBase.php.

Referenced by checkSvgScriptCallback().

Here is the caller graph for this function:

static UploadBase::userCanReUpload ( User user,
img 
) [static]

Check if a user is the last uploader.

Parameters:
$userUser object
$imgString: image name
Returns:
Boolean

Definition at line 1510 of file UploadBase.php.

Referenced by ImagePage\uploadLinksBox().

Here is the caller graph for this function:

UploadBase::validateName ( ) [protected]

Verify that the name is valid and, if necessary, that we can overwrite.

Returns:
mixed true if valid, otherwise and array with 'status' and other keys

Definition at line 281 of file UploadBase.php.

References $result, getLocalFile(), and getTitle().

Referenced by verifyUpload().

Here is the call graph for this function:

Here is the caller graph for this function:

static UploadBase::verifyExtension ( mime,
extension 
) [static]

Checks if the mime type of the uploaded file matches the file extension.

Parameters:
$mimeString: the mime type of the uploaded file
$extensionString: the filename extension that the file is to be served with
Returns:
Boolean

Definition at line 864 of file UploadBase.php.

References $mime, MimeMagic\singleton(), and wfDebug().

Referenced by verifyFile().

Here is the call graph for this function:

Here is the caller graph for this function:

UploadBase::verifyFile ( ) [protected]

Verifies that it's ok to include the uploaded file.

Returns:
mixed true of the file is verified, array otherwise.

Definition at line 341 of file UploadBase.php.

References $mime, $wgVerifyMimeType, MediaHandler\getHandler(), FSFile\getPropsFromPath(), verifyExtension(), verifyPartialFile(), wfDebug(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by verifyUpload().

Here is the call graph for this function:

Here is the caller graph for this function:

UploadBase::verifyMimeType ( mime) [protected]

Verify the mime type.

Note:
Only checks that it is not an evil mime. The does it have correct extension given its mime type check is in verifyFile.
Parameters:
$mimestring representing the mime
Returns:
mixed true if the file is verified, an array otherwise

Definition at line 309 of file UploadBase.php.

References $mime, $wgMimeTypeBlacklist, $wgVerifyMimeType, checkFileExtension(), MimeMagic\singleton(), and wfDebug().

Referenced by verifyPartialFile().

Here is the call graph for this function:

Here is the caller graph for this function:

A verification routine suitable for partial files.

Runs the blacklist checks, but not any checks that may assume the entire file is present.

Returns:
Mixed true for valid or array with error message key.

Definition at line 391 of file UploadBase.php.

References $mime, $wgAllowJavaUploads, $wgDisableUploadScriptChecks, detectScriptInSvg(), detectVirus(), FSFile\getPropsFromPath(), getTitle(), ZipDirectoryReader\read(), and verifyMimeType().

Referenced by UploadFromChunks\verifyChunk(), and verifyFile().

Here is the call graph for this function:

Here is the caller graph for this function:

Alias for verifyTitlePermissions.

The function was originally 'verifyPermissions' but that suggests it's checking the user, when it's really checking the title + user combination.

Parameters:
$userUser object to verify the permissions against
Returns:
mixed An array as returned by getUserPermissionsErrors or true in case the user has proper permissions.

Definition at line 476 of file UploadBase.php.

References $user, and verifyTitlePermissions().

Here is the call graph for this function:

Check whether the user can edit, upload and create the image.

This checks only against the current title; if it returns errors, it may very well be that another title will not give errors. Therefore isAllowed() should be called as well for generic is-user-blocked or can-user-upload checking.

Parameters:
$userUser object to verify the permissions against
Returns:
mixed An array as returned by getUserPermissionsErrors or true in case the user has proper permissions.

Reimplemented in UploadFromUrl.

Definition at line 491 of file UploadBase.php.

References $user, checkOverwrite(), getTitle(), and wfArrayDiff2().

Referenced by verifyPermissions().

Here is the call graph for this function:

Here is the caller graph for this function:

Verify whether the upload is sane.

Returns:
mixed self::OK or else an array with error information

Reimplemented in UploadFromUrl, and UploadFromFile.

Definition at line 226 of file UploadBase.php.

References $result, getMaxUploadSize(), getSourceType(), isEmptyFile(), validateName(), verifyFile(), and wfRunHooks().

Here is the call graph for this function:

Callback for ZipDirectoryReader to detect Java class files.

Definition at line 449 of file UploadBase.php.


Member Data Documentation

UploadBase::$mBlackListedExtensions [protected]

Definition at line 24 of file UploadBase.php.

UploadBase::$mDesiredDestName [protected]

Definition at line 20 of file UploadBase.php.

UploadBase::$mDestName

Definition at line 20 of file UploadBase.php.

UploadBase::$mFileProps

Reimplemented in UploadFromStash.

Definition at line 23 of file UploadBase.php.

UploadBase::$mFileSize

Definition at line 23 of file UploadBase.php.

UploadBase::$mFilteredName [protected]

Definition at line 22 of file UploadBase.php.

UploadBase::$mFinalExtension

Definition at line 22 of file UploadBase.php.

UploadBase::$mJavaDetected [protected]

Definition at line 25 of file UploadBase.php.

UploadBase::$mLocalFile [protected]

Definition at line 23 of file UploadBase.php.

UploadBase::$mRemoveTempFile

Definition at line 20 of file UploadBase.php.

UploadBase::$mSourceType

Reimplemented in UploadFromStash.

Definition at line 20 of file UploadBase.php.

UploadBase::$mSVGNSError

Definition at line 25 of file UploadBase.php.

UploadBase::$mTempPath [protected]

Reimplemented in UploadFromUrl.

Definition at line 19 of file UploadBase.php.

UploadBase::$mTitle = false [protected]

Definition at line 21 of file UploadBase.php.

UploadBase::$mTitleError = 0

Definition at line 21 of file UploadBase.php.

UploadBase::$safeXmlEncodings = array( 'UTF-8', 'ISO-8859-1', 'ISO-8859-2', 'UTF-16', 'UTF-32' ) [static, protected]

Definition at line 27 of file UploadBase.php.

UploadBase::$uploadHandlers = array( 'Stash', 'File', 'Url' ) [static]

Definition at line 98 of file UploadBase.php.

Definition at line 34 of file UploadBase.php.

Definition at line 29 of file UploadBase.php.

Definition at line 40 of file UploadBase.php.


The documentation for this class was generated from the following file: