MediaWiki
master
|
UploadBase and subclasses are the backend of MediaWiki's file uploads. More...
Public Member Functions | |
__construct () | |
checkSvgScriptCallback ($element, $attribs, $data=null) | |
checkWarnings () | |
Check for non fatal problems with the file. More... | |
cleanupTempFile () | |
If we've modified the upload file we need to manually remove it on exit to clean up. More... | |
convertVerifyErrorToStatus ($error) | |
fetchFile () | |
Fetch the file. More... | |
getFileSize () | |
Return the file size. More... | |
getImageInfo ($result) | |
Gets image info about the file just uploaded. More... | |
getLocalFile () | |
Return the local file and initializes if necessary. More... | |
getRealPath ($srcPath) | |
getSourceType () | |
Returns the upload type. More... | |
getTempFileSha1Base36 () | |
Get the base 36 SHA1 of the file. More... | |
getTempPath () | |
getTitle () | |
Returns the title of the file to be uploaded. More... | |
getVerificationErrorCode ($error) | |
initializeFromRequest (&$request) | |
Initialize from a WebRequest. More... | |
initializePathInfo ($name, $tempPath, $fileSize, $removeTempFile=false) | |
Initialize the path information. More... | |
isEmptyFile () | |
Return true if the file is empty. More... | |
performUpload ($comment, $pageText, $watch, $user, $tags=[]) | |
Really perform the upload. More... | |
postProcessUpload () | |
Perform extra steps after a successful upload. More... | |
stashFile (User $user=null) | |
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. More... | |
stashFileGetKey () | |
Stash a file in a temporary directory, returning a key which can be used to find the file again. More... | |
stashSession () | |
alias for stashFileGetKey, for backwards compatibility More... | |
validateName () | |
Verify that the name is valid and, if necessary, that we can overwrite. More... | |
verifyPermissions ($user) | |
Alias for verifyTitlePermissions. More... | |
verifyTitlePermissions ($user) | |
Check whether the user can edit, upload and create the image. More... | |
verifyUpload () | |
Verify whether the upload is sane. More... | |
zipEntryCallback ($entry) | |
Callback for ZipDirectoryReader to detect Java class files. More... | |
Static Public Member Functions | |
static | checkFileExtension ($ext, $list) |
Perform case-insensitive match against a list of file extensions. More... | |
static | checkFileExtensionList ($ext, $list) |
Perform case-insensitive match against a list of file extensions. More... | |
static | checkSvgPICallback ($target, $data) |
Callback to filter SVG Processing Instructions. More... | |
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. More... | |
static | createFromRequest (&$request, $type=null) |
Create a form of UploadBase depending on wpSourceType and initializes it. More... | |
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. More... | |
static | detectVirus ($file) |
Generic wrapper function for a virus scanner program. More... | |
static | getExistsWarning ($file) |
Helper function that does various existence checks for a file. More... | |
static | getFilenamePrefixBlacklist () |
Get a list of blacklisted filename prefixes from [[MediaWiki:Filename-prefix-blacklist]]. More... | |
static | getMaxPhpUploadSize () |
Get the PHP maximum uploaded file size, based on ini settings. More... | |
static | getMaxUploadSize ($forType=null) |
Get the MediaWiki maximum uploaded file size for given type of upload, based on $wgMaxUploadSize. More... | |
static | getSessionStatus (User $user, $statusKey) |
Get the current status of a chunked upload (used for polling) More... | |
static | isAllowed ($user) |
Returns true if the user can use this upload module or else a string identifying the missing permission. More... | |
static | isEnabled () |
Returns true if uploads are enabled. More... | |
static | isThrottled ($user) |
Returns true if the user has surpassed the upload rate limit, false otherwise. More... | |
static | isThumbName ($filename) |
Helper function that checks whether the filename looks like a thumbnail. More... | |
static | isValidRequest ($request) |
Check whether a request if valid for this handler. More... | |
static | setSessionStatus (User $user, $statusKey, $value) |
Set the current status of a chunked upload (used for polling) More... | |
static | splitExtensions ($filename) |
Split a file into a base name and all dot-delimited 'extensions' on the end. More... | |
static | userCanReUpload (User $user, File $img) |
Check if a user is the last uploader. More... | |
static | verifyExtension ($mime, $extension) |
Checks if the MIME type of the uploaded file matches the file extension. More... | |
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 | VERIFICATION_ERROR = 10 |
const | WINDOWS_NONASCII_FILENAME = 13 |
Protected Member Functions | |
detectScriptInSvg ($filename, $partial) | |
setTempFile ($tempPath, $fileSize=null) | |
verifyFile () | |
Verifies that it's ok to include the uploaded file. More... | |
verifyMimeType ($mime) | |
Verify the MIME type. More... | |
verifyPartialFile () | |
A verification routine suitable for partial files. More... | |
Protected Attributes | |
$mBlackListedExtensions | |
$mDesiredDestName | |
$mFilteredName | |
$mJavaDetected | |
$mLocalFile | |
string | $mTempPath |
Local file system path to the file to upload (or a local copy) More... | |
$mTitle = false | |
TempFSFile null | $tempFileObj |
Wrapper to handle deleting the temp file. More... | |
Static Protected Attributes | |
static | $safeXmlEncodings |
Private Member Functions | |
checkOverwrite ($user) | |
Check if there's an overwrite conflict and, if so, if restrictions forbid this user from performing the upload. More... | |
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. More... | |
static | splitXmlNamespace ($element) |
Divide the element name passed by the xml parser to the callback into URI and prifix. More... | |
Static Private Attributes | |
static | $uploadHandlers = [ 'Stash', 'File', 'Url' ] |
UploadBase and subclasses are the backend of MediaWiki's file uploads.
The frontends are formed by ApiUpload and SpecialUpload.
Definition at line 38 of file UploadBase.php.
UploadBase::__construct | ( | ) |
Definition at line 200 of file UploadBase.php.
|
staticprivate |
Check a block of CSS or CSS fragment for anything that looks like it is bringing in remote code.
string | $value | a string of CSS |
bool | $propOnly | only check css properties (start regex with :) |
Definition at line 1558 of file UploadBase.php.
|
static |
Perform case-insensitive match against a list of file extensions.
Returns true if the extension is in the list.
string | $ext | |
array | $list |
Definition at line 1022 of file UploadBase.php.
References $ext.
Referenced by checkWarnings(), getTitle(), and verifyMimeType().
|
static |
Perform case-insensitive match against a list of file extensions.
Returns an array of matching extensions.
array | $ext | |
array | $list |
Definition at line 1034 of file UploadBase.php.
References $ext.
Referenced by StreamFile\contentTypeFromPath(), and getTitle().
|
private |
Check if there's an overwrite conflict and, if so, if restrictions forbid this user from performing the upload.
User | $user |
Definition at line 1735 of file UploadBase.php.
Referenced by verifyTitlePermissions().
|
static |
Callback to filter SVG Processing Instructions.
string | $target | Processing instruction name |
string | $data | Processing instruction attribute and value |
Definition at line 1314 of file UploadBase.php.
UploadBase::checkSvgScriptCallback | ( | $element, | |
$attribs, | |||
$data = null |
|||
) |
string | $element | |
array | $attribs |
Definition at line 1329 of file UploadBase.php.
References $attribs, $value, as, list, Sanitizer\normalizeCss(), splitXmlNamespace(), stripXmlNamespace(), and wfDebug().
UploadBase::checkWarnings | ( | ) |
Check for non fatal problems with the file.
This should not assume that mTempPath is set.
Definition at line 634 of file UploadBase.php.
References $extensions, $mFileSize, $mFinalExtension, $title, $wgCheckFileExtensions, $wgFileExtensions, $wgLang, $wgUploadSizeWarning, as, Title\capitalize(), checkFileExtension(), File\DELETED_FILE, Content\equals(), getLocalFile(), getTempFileSha1Base36(), getTitle(), global, NS_FILE, IDBAccessObject\READ_LATEST, and RepoGroup\singleton().
|
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.
string | $file | Pathname to the temporary upload file |
Definition at line 1227 of file UploadBase.php.
References $matches, $wgSVGMetadataCutoff, as, global, and wfDebug().
UploadBase::cleanupTempFile | ( | ) |
If we've modified the upload file we need to manually remove it on exit to clean up.
Definition at line 986 of file UploadBase.php.
References wfDebug().
UploadBase::convertVerifyErrorToStatus | ( | $error | ) |
array | $error |
Definition at line 1953 of file UploadBase.php.
References $code, getVerificationErrorCode(), and Status\newFatal().
|
static |
Create a form of UploadBase depending on wpSourceType and initializes it.
WebRequest | $request | |
string | null | $type |
Definition at line 152 of file UploadBase.php.
References $handler, $request, $type, Hooks\run(), and wfDebug().
Referenced by SpecialUpload\loadRequest().
|
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.
string | $file | Pathname to the temporary upload file |
string | $mime | The MIME type of the file |
string | $extension | The extension of the file |
Definition at line 1098 of file UploadBase.php.
References $mime, $tag, $wgAllowTitlesInSVG, as, Sanitizer\decodeCharReferences(), global, in, and wfDebug().
|
protected |
string | $filename | |
bool | $partial |
Definition at line 1285 of file UploadBase.php.
References $mSVGNSError.
Referenced by verifyFile(), and verifyPartialFile().
|
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.
string | $file | Pathname to the temporary upload file |
Definition at line 1638 of file UploadBase.php.
References $command, $output, $wgAntivirus, $wgAntivirusRequired, $wgAntivirusSetup, $wgOut, AV_NO_VIRUS, AV_SCAN_ABORTED, AV_SCAN_FAILED, global, there, wfDebug(), wfEscapeShellArg(), wfMessage(), and wfShellExecWithStderr().
Referenced by verifyPartialFile().
UploadBase::fetchFile | ( | ) |
Fetch the file.
Usually a no-op
Definition at line 259 of file UploadBase.php.
References Status\newGood().
|
static |
Helper function that does various existence checks for a file.
The following checks are performed:
Definition at line 1792 of file UploadBase.php.
Referenced by ApiQueryImageInfo\getInfo().
|
static |
Get a list of blacklisted filename prefixes from [[MediaWiki:Filename-prefix-blacklist]].
Definition at line 1897 of file UploadBase.php.
References $comment, $line, $lines, as, and wfMessage().
UploadBase::getFileSize | ( | ) |
Return the file size.
Definition at line 275 of file UploadBase.php.
References $mFileSize.
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.
ApiResult | $result |
Definition at line 1931 of file UploadBase.php.
References ApiQueryImageInfo\getInfo(), getLocalFile(), and ApiQueryImageInfo\getPropertyNames().
UploadBase::getLocalFile | ( | ) |
Return the local file and initializes if necessary.
Definition at line 929 of file UploadBase.php.
References $mLocalFile, getTitle(), and wfLocalFile().
Referenced by checkWarnings(), getImageInfo(), performUpload(), postProcessUpload(), and validateName().
|
static |
Get the PHP maximum uploaded file size, based on ini settings.
If there is no limit or the limit can't be guessed, returns a very large number (PHP_INT_MAX).
Definition at line 1988 of file UploadBase.php.
References wfShorthandToInteger().
Referenced by UploadForm\getSourceSection().
|
static |
Get the MediaWiki maximum uploaded file size for given type of upload, based on $wgMaxUploadSize.
null | string | $forType |
Definition at line 1967 of file UploadBase.php.
References $wgMaxUploadSize, and global.
Referenced by UploadFromChunks\addChunk(), UploadForm\addUploadJS(), ApiQuerySiteinfo\appendGeneralInfo(), ApiUpload\execute(), ApiUpload\getAllowedParams(), and UploadForm\getSourceSection().
UploadBase::getRealPath | ( | $srcPath | ) |
string | $srcPath | The source path |
Definition at line 291 of file UploadBase.php.
References $path, and RepoGroup\singleton().
Referenced by UploadFromChunks\continueChunks(), and UploadFromStash\initialize().
|
static |
Get the current status of a chunked upload (used for polling)
The value will be read from cache.
User | $user | |
string | $statusKey |
Definition at line 2009 of file UploadBase.php.
References User\getId(), ObjectCache\getMainStashInstance(), User\getName(), and wfMemcKey().
Referenced by ApiUpload\getChunkResult(), ApiUpload\performUpload(), and ApiUpload\selectUploadModule().
UploadBase::getSourceType | ( | ) |
Returns the upload type.
Should be overridden by child classes
Definition at line 209 of file UploadBase.php.
Referenced by stashFile(), and verifyUpload().
UploadBase::getTempFileSha1Base36 | ( | ) |
Get the base 36 SHA1 of the file.
Definition at line 283 of file UploadBase.php.
References FSFile\getSha1Base36FromPath().
Referenced by checkWarnings().
UploadBase::getTempPath | ( | ) |
Definition at line 994 of file UploadBase.php.
References $mTempPath.
UploadBase::getTitle | ( | ) |
Returns the title of the file to be uploaded.
Sets mTitleError in case the name was illegal.
Definition at line 797 of file UploadBase.php.
References $ext, $mDesiredDestName, $mFinalExtension, $mime, $mTitle, $title, $wgCheckFileExtensions, $wgFileBlacklist, $wgFileExtensions, $wgStrictFileExtensions, checkFileExtension(), checkFileExtensionList(), global, list, Title\makeTitleSafe(), Title\newFromText(), NS_FILE, RepoGroup\singleton(), MimeMagic\singleton(), splitExtensions(), and wfStripIllegalFilenameChars().
Referenced by checkWarnings(), getLocalFile(), performUpload(), UploadTestHandler\testTitleValidation(), validateName(), verifyPartialFile(), and verifyTitlePermissions().
UploadBase::getVerificationErrorCode | ( | $error | ) |
int | $error |
Definition at line 77 of file UploadBase.php.
Referenced by UploadFromChunks\concatenateChunks(), and convertVerifyErrorToStatus().
|
abstract |
UploadBase::initializePathInfo | ( | $name, | |
$tempPath, | |||
$fileSize, | |||
$removeTempFile = false |
|||
) |
Initialize the path information.
string | $name | The desired destination name |
string | $tempPath | The temporary path |
int | $fileSize | The file size |
bool | $removeTempFile | (false) remove the temporary file? |
MWException |
Definition at line 221 of file UploadBase.php.
References $name, FileBackend\isStoragePath(), and setTempFile().
Referenced by UploadFromChunks\continueChunks(), UploadFromFile\initialize(), UploadFromStash\initialize(), and UploadFromUrl\initialize().
|
static |
Returns true if the user can use this upload module or else a string identifying the missing permission.
Can be overridden by subclasses.
User | $user |
Definition at line 122 of file UploadBase.php.
Referenced by SkinTemplate\buildNavUrls(), and SpecialUpload\execute().
UploadBase::isEmptyFile | ( | ) |
Return true if the file is empty.
Definition at line 267 of file UploadBase.php.
Referenced by UploadFromFile\verifyUpload(), and verifyUpload().
|
static |
Returns true if uploads are enabled.
Can be override by subclasses.
Definition at line 103 of file UploadBase.php.
References $wgEnableUploads, global, wfIniGetBool(), and wfIsHHVM().
Referenced by ApiQuerySiteinfo\appendGeneralInfo(), SkinTemplate\buildNavUrls(), ApiUpload\execute(), SpecialUpload\execute(), and SpecialUpload\userCanExecute().
|
static |
Returns true if the user has surpassed the upload rate limit, false otherwise.
User | $user |
Definition at line 138 of file UploadBase.php.
References $user.
Referenced by ApiUpload\getContextResult(), and SpecialUpload\processUpload().
|
static |
Helper function that checks whether the filename looks like a thumbnail.
string | $filename |
Definition at line 1881 of file UploadBase.php.
|
static |
Check whether a request if valid for this handler.
WebRequest | $request |
Definition at line 196 of file UploadBase.php.
UploadBase::performUpload | ( | $comment, | |
$pageText, | |||
$watch, | |||
$user, | |||
$tags = [] |
|||
) |
Really perform the upload.
Stores the file in the local repo, watches if necessary and runs the UploadComplete hook.
string | $comment | |
string | $pageText | |
bool | $watch | Whether the file page should be added to user's watchlist. (This doesn't check $user's permissions.) |
User | $user | |
string[] | $tags Change tags to add to the log entry and page revision. (This doesn't check $user's permissions.) |
Definition at line 722 of file UploadBase.php.
References $comment, $mFileProps, $status, $user, File\DELETE_SOURCE, WatchAction\doWatch(), getLocalFile(), getTitle(), User\IGNORE_USER_RIGHTS, postProcessUpload(), IDBAccessObject\READ_LATEST, and Hooks\run().
UploadBase::postProcessUpload | ( | ) |
Perform extra steps after a successful upload.
Definition at line 767 of file UploadBase.php.
References $wgUploadThumbnailRenderMap, as, getLocalFile(), global, and JobQueueGroup\singleton().
Referenced by performUpload().
|
static |
Set the current status of a chunked upload (used for polling)
The value will be set in cache for 1 day
User | $user | |
string | $statusKey | |
array | bool | $value |
Definition at line 2025 of file UploadBase.php.
References $cache, $value, User\getId(), ObjectCache\getMainStashInstance(), User\getName(), and wfMemcKey().
Referenced by ApiUpload\getChunkResult(), ApiUpload\performUpload(), AssembleUploadChunksJob\run(), and PublishStashedFileJob\run().
|
protected |
string | $tempPath | File system path to temporary file containing the upload |
integer | $fileSize |
Definition at line 242 of file UploadBase.php.
Referenced by UploadFromChunks\concatenateChunks(), and initializePathInfo().
|
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.
string | $filename |
Definition at line 1007 of file UploadBase.php.
Referenced by StreamFile\contentTypeFromPath(), and getTitle().
|
staticprivate |
Divide the element name passed by the xml parser to the callback into URI and prifix.
string | $element |
Definition at line 1608 of file UploadBase.php.
References $name.
Referenced by checkSvgScriptCallback().
UploadBase::stashFile | ( | User | $user = null | ) |
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.
User | $user |
Definition at line 953 of file UploadBase.php.
References $user, getSourceType(), and RepoGroup\singleton().
Referenced by stashFileGetKey().
UploadBase::stashFileGetKey | ( | ) |
Stash a file in a temporary directory, returning a key which can be used to find the file again.
See stashFile().
Definition at line 969 of file UploadBase.php.
References stashFile().
Referenced by stashSession().
UploadBase::stashSession | ( | ) |
alias for stashFileGetKey, for backwards compatibility
Definition at line 978 of file UploadBase.php.
References stashFileGetKey().
|
private |
string | $name |
Definition at line 1621 of file UploadBase.php.
References $name.
Referenced by checkSvgScriptCallback().
Check if a user is the last uploader.
Definition at line 1765 of file UploadBase.php.
Referenced by ImagePage\uploadLinksBox().
UploadBase::validateName | ( | ) |
Verify that the name is valid and, if necessary, that we can overwrite.
Definition at line 370 of file UploadBase.php.
References $mBlackListedExtensions, $mFilteredName, $mFinalExtension, $mTitleError, getLocalFile(), and getTitle().
Referenced by verifyUpload().
|
static |
Checks if the MIME type of the uploaded file matches the file extension.
string | $mime | The MIME type of the uploaded file |
string | $extension | The filename extension that the file is to be served with |
Definition at line 1045 of file UploadBase.php.
References $mime, MimeMagic\singleton(), and wfDebug().
Referenced by verifyFile().
|
protected |
Verifies that it's ok to include the uploaded file.
Definition at line 432 of file UploadBase.php.
References $handler, $mFinalExtension, $mime, $status, $wgDisableUploadScriptChecks, $wgVerifyMimeType, detectScriptInSvg(), MediaHandler\getHandler(), FSFile\getPropsFromPath(), global, Hooks\run(), verifyExtension(), verifyPartialFile(), and wfDebug().
Referenced by verifyUpload().
|
protected |
Verify the MIME type.
verifyFile()
that MIME type and file extension correlate. string | $mime | Representing the MIME |
Definition at line 400 of file UploadBase.php.
References $mime, $wgMimeTypeBlacklist, $wgVerifyMimeType, as, checkFileExtension(), global, MimeMagic\singleton(), and wfDebug().
Referenced by verifyPartialFile().
|
protected |
A verification routine suitable for partial files.
Runs the blacklist checks, but not any checks that may assume the entire file is present.
Definition at line 492 of file UploadBase.php.
References $mime, $status, $wgAllowJavaUploads, $wgDisableUploadScriptChecks, detectScriptInSvg(), detectVirus(), FSFile\getPropsFromPath(), getTitle(), global, ZipDirectoryReader\read(), and verifyMimeType().
Referenced by UploadFromChunks\verifyChunk(), and verifyFile().
UploadBase::verifyPermissions | ( | $user | ) |
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.
Definition at line 581 of file UploadBase.php.
References $user, and verifyTitlePermissions().
UploadBase::verifyTitlePermissions | ( | $user | ) |
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.
Definition at line 596 of file UploadBase.php.
References $user, checkOverwrite(), getTitle(), and wfArrayDiff2().
Referenced by verifyPermissions().
UploadBase::verifyUpload | ( | ) |
Verify whether the upload is sane.
Definition at line 313 of file UploadBase.php.
References getSourceType(), isEmptyFile(), Hooks\run(), validateName(), and verifyFile().
UploadBase::zipEntryCallback | ( | $entry | ) |
Callback for ZipDirectoryReader to detect Java class files.
array | $entry |
Definition at line 552 of file UploadBase.php.
|
protected |
Definition at line 48 of file UploadBase.php.
Referenced by validateName().
|
protected |
Definition at line 44 of file UploadBase.php.
Referenced by getTitle(), and UploadFromChunks\verifyChunk().
UploadBase::$mDestName |
Definition at line 44 of file UploadBase.php.
UploadBase::$mFileProps |
Definition at line 47 of file UploadBase.php.
Referenced by performUpload().
UploadBase::$mFileSize |
Definition at line 47 of file UploadBase.php.
Referenced by checkWarnings(), and getFileSize().
|
protected |
Definition at line 46 of file UploadBase.php.
Referenced by validateName().
UploadBase::$mFinalExtension |
Definition at line 46 of file UploadBase.php.
Referenced by checkWarnings(), getTitle(), validateName(), and verifyFile().
|
protected |
Definition at line 49 of file UploadBase.php.
|
protected |
Definition at line 47 of file UploadBase.php.
Referenced by getLocalFile(), UploadFromChunks\stashFile(), and UploadFromStash\stashFile().
UploadBase::$mRemoveTempFile |
Definition at line 44 of file UploadBase.php.
UploadBase::$mSourceType |
Definition at line 44 of file UploadBase.php.
UploadBase::$mSVGNSError |
Definition at line 49 of file UploadBase.php.
Referenced by detectScriptInSvg().
|
protected |
Local file system path to the file to upload (or a local copy)
Definition at line 40 of file UploadBase.php.
Referenced by UploadFromChunks\addChunk(), and getTempPath().
|
protected |
Definition at line 45 of file UploadBase.php.
Referenced by getTitle().
UploadBase::$mTitleError = 0 |
Definition at line 45 of file UploadBase.php.
Referenced by UploadTestHandler\testTitleValidation(), and validateName().
|
staticprotected |
Definition at line 51 of file UploadBase.php.
|
protected |
Wrapper to handle deleting the temp file.
Definition at line 42 of file UploadBase.php.
|
staticprivate |
Definition at line 143 of file UploadBase.php.
const UploadBase::EMPTY_FILE = 3 |
Definition at line 61 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), SpecialUpload\processVerificationError(), and UploadBaseTest\testVerifyUpload().
const UploadBase::FILE_TOO_LARGE = 12 |
Definition at line 69 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), SpecialUpload\processVerificationError(), and UploadFromFile\verifyUpload().
const UploadBase::FILENAME_TOO_LONG = 14 |
Definition at line 71 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), SpecialUpload\processVerificationError(), and UploadBaseTest\provideTestTitleValidation().
const UploadBase::FILETYPE_BADTYPE = 9 |
Definition at line 66 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), and SpecialUpload\processVerificationError().
const UploadBase::FILETYPE_MISSING = 8 |
Definition at line 65 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), SpecialUpload\processVerificationError(), and UploadBaseTest\provideTestTitleValidation().
const UploadBase::HOOK_ABORTED = 11 |
Definition at line 68 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), and SpecialUpload\processVerificationError().
const UploadBase::ILLEGAL_FILENAME = 5 |
Definition at line 63 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), SpecialUpload\processVerificationError(), and UploadBaseTest\provideTestTitleValidation().
const UploadBase::MIN_LENGTH_PARTNAME = 4 |
Definition at line 62 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), SpecialUpload\processVerificationError(), and UploadBaseTest\provideTestTitleValidation().
const UploadBase::OK = 0 |
Definition at line 60 of file UploadBase.php.
Referenced by UploadFromChunks\concatenateChunks(), SpecialUpload\processUpload(), UploadBaseTest\provideTestTitleValidation(), PublishStashedFileJob\run(), UploadBaseTest\testMaxUploadSize(), UploadBaseTest\testTitleValidation(), UploadTestHandler\testTitleValidation(), and ApiUpload\verifyUpload().
const UploadBase::OVERWRITE_EXISTING_FILE = 7 |
Definition at line 64 of file UploadBase.php.
const UploadBase::SUCCESS = 0 |
Definition at line 59 of file UploadBase.php.
const UploadBase::VERIFICATION_ERROR = 10 |
Definition at line 67 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), and SpecialUpload\processVerificationError().
const UploadBase::WINDOWS_NONASCII_FILENAME = 13 |
Definition at line 70 of file UploadBase.php.
Referenced by ApiUpload\checkVerification(), and SpecialUpload\processVerificationError().