41 $this->doesExist = isset( $_FILES[$key] );
42 if ( $this->doesExist ) {
43 $this->fileInfo = $_FILES[$key];
67 $name = $this->fileInfo[
'name'];
69 # Safari sends filenames in HTML-encoded Unicode form D...
70 # Horrid and evil! Let's try to make some kind of sense of it.
71 $name = Sanitizer::decodeCharReferences( $name );
73 wfDebug( __METHOD__ .
": {$this->fileInfo['name']} normalized to '$name'\n" );
87 return $this->fileInfo[
'size'];
100 return $this->fileInfo[
'tmp_name'];
111 return 0; # UPLOAD_ERR_OK
114 return $this->fileInfo[
'error'];
124 if ( $this->
getError() == UPLOAD_ERR_INI_SIZE ) {
125 # PHP indicated that upload_max_filesize is exceeded
129 $contentLength = $this->request->getHeader(
'Content-Length' );
131 ini_get(
'post_max_size' ) ?: ini_get(
'hhvm.server.max_post_size' ),
135 if ( $maxPostSize && $contentLength > $maxPostSize ) {
136 # post_max_size is exceeded
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
Object to access the $_FILES array.
getError()
Return the upload error.
isIniSizeOverflow()
Returns whether this upload failed because of overflow of a maximum set in php.ini.
exists()
Return whether a file with this name was uploaded.
__construct( $request, $key)
Constructor.
getSize()
Return the file size of the uploaded file.
getTempName()
Return the path to the temporary file.
getName()
Return the original filename of the uploaded file.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
Allows to change the fields on the form that will be generated $name