55 $this->doesExist = isset( $_FILES[$key] );
56 if ( $this->doesExist ) {
57 $this->fileInfo = $_FILES[$key];
81 $name = $this->fileInfo[
'name'];
83 # Safari sends filenames in HTML-encoded Unicode form D...
84 # Horrid and evil! Let's try to make some kind of sense of it.
85 $name = Sanitizer::decodeCharReferences( $name );
88 wfDebug( __METHOD__ .
": {$this->fileInfo['name']} normalized to '$name'" );
103 return $this->fileInfo[
'size'];
117 return $this->fileInfo[
'tmp_name'];
132 return $this->fileInfo[
'type'];
143 return 0; # UPLOAD_ERR_OK
147 return $this->fileInfo[
'error'];
157 if ( $this->
getError() == UPLOAD_ERR_INI_SIZE ) {
158 # PHP indicated that upload_max_filesize is exceeded
162 $contentLength = $this->request->getHeader(
'Content-Length' );
165 if ( $maxPostSize && $contentLength > $maxPostSize ) {
166 # post_max_size is exceeded
174class_alias( WebRequestUpload::class,
'WebRequestUpload' );
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfShorthandToInteger(?string $string='', int $default=-1)
Converts shorthand byte notation to integer form.
HTML sanitizer for MediaWiki.
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...