54 $this->doesExist = isset( $_FILES[$key] );
55 if ( $this->doesExist ) {
56 $this->fileInfo = $_FILES[$key];
80 $name = $this->fileInfo[
'name'];
82 # Safari sends filenames in HTML-encoded Unicode form D...
83 # Horrid and evil! Let's try to make some kind of sense of it.
84 $name = Sanitizer::decodeCharReferences( $name );
87 wfDebug( __METHOD__ .
": {$this->fileInfo['name']} normalized to '$name'" );
102 return $this->fileInfo[
'size'];
116 return $this->fileInfo[
'tmp_name'];
131 return $this->fileInfo[
'type'];
142 return 0; # UPLOAD_ERR_OK
146 return $this->fileInfo[
'error'];
156 if ( $this->
getError() == UPLOAD_ERR_INI_SIZE ) {
157 # PHP indicated that upload_max_filesize is exceeded
161 $contentLength = $this->request->getHeader(
'Content-Length' );
164 if ( $maxPostSize && $contentLength > $maxPostSize ) {
165 # 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.