}
/**
- * @param string $srcPath the source path
- * @returns the real path if it was a virtual URL
+ * @param $srcPath String: the source path
+ * @return the real path if it was a virtual URL
*/
function getRealPath( $srcPath ) {
$repo = RepoGroup::singleton()->getLocalRepo();
/**
* Check whether the user can edit, upload and create the image.
*
- * @param User $user the user to verify the permissions against
+ * @param $user the User object to verify the permissions against
* @return mixed An array as returned by getUserPermissionsErrors or true
* in case the user has proper permissions.
*/
/**
* Check for non fatal problems with the file
*
- * @return array Array of warnings
+ * @return Array of warnings
*/
public function checkWarnings() {
$warnings = array();
* If the user doesn't explicitly cancel or accept, these files
* can accumulate in the temp directory.
*
- * @param string $saveName - the destination filename
- * @param string $tempSrc - the source temporary file to save
- * @return string - full path the stashed file, or false on failure
+ * @param $saveName String: the destination filename
+ * @param $tempSrc String: the source temporary file to save
+ * @return String: full path the stashed file, or false on failure
*/
protected function saveTempUploadedFile( $saveName, $tempSrc ) {
$repo = RepoGroup::singleton()->getLocalRepo();
* Returns a key value which will be passed through a form
* to pick up the path info on a later invocation.
*
- * @return int Session key
+ * @return Integer: session key
*/
public function stashSession() {
$status = $this->saveTempUploadedFile( $this->mDestName, $this->mTempPath );
* Perform case-insensitive match against a list of file extensions.
* Returns true if the extension is in the list.
*
- * @param string $ext
- * @param array $list
- * @return bool
+ * @param $ext String
+ * @param $list Array
+ * @return Boolean
*/
public static function checkFileExtension( $ext, $list ) {
return in_array( strtolower( $ext ), $list );
* Perform case-insensitive match against a list of file extensions.
* Returns true if any of the extensions are in the list.
*
- * @param array $ext
- * @param array $list
- * @return bool
+ * @param $ext Array
+ * @param $list Array
+ * @return Boolean
*/
public static function checkFileExtensionList( $ext, $list ) {
foreach( $ext as $e ) {
/**
* Checks if the mime type of the uploaded file matches the file extension.
*
- * @param string $mime the mime type of the uploaded file
- * @param string $extension The filename extension that the file is to be served with
- * @return bool
+ * @param $mime String: the mime type of the uploaded file
+ * @param $extension String: the filename extension that the file is to be served with
+ * @return Boolean
*/
public static function verifyExtension( $mime, $extension ) {
$magic = MimeMagic::singleton();
* potentially harmful. The present implementation will produce false
* positives in some situations.
*
- * @param string $file Pathname to the temporary upload file
- * @param string $mime The mime type of the file
- * @param string $extension The extension of the file
- * @return bool true if the file contains something looking like embedded scripts
+ * @param $file String: pathname to the temporary upload file
+ * @param $mime String: the mime type of the file
+ * @param $extension String: the extension of the file
+ * @return Boolean: true if the file contains something looking like embedded scripts
*/
public static function detectScript( $file, $mime, $extension ) {
global $wgAllowTitlesInSVG;
* This relies on the $wgAntivirus and $wgAntivirusSetup variables.
* $wgAntivirusRequired may be used to deny upload if the scan fails.
*
- * @param string $file Pathname to the temporary upload file
+ * @param $file String: pathname to the temporary upload file
* @return 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.
/**
* Check if a user is the last uploader
*
- * @param User $user
- * @param string $img, image name
- * @return bool
+ * @param $user User object
+ * @param $img String: image name
+ * @return Boolean
*/
public static function userCanReUpload( User $user, $img ) {
if( $user->isAllowed( 'reupload' ) ) {
* - File exists with normalized extension
* - The file looks like a thumbnail and the original exists
*
- * @param File $file The file to check
+ * @param $file The File object to check
* @return mixed False if the file does not exists, else an array
*/
public static function getExistsWarning( $file ) {