From: Mark A. Hershberger Date: Fri, 22 Jan 2010 03:14:52 +0000 (+0000) Subject: ws only cleanup X-Git-Tag: 1.31.0-rc.0~38176 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=b15cccb6889d1ef2fd76cde663638a72e3034f1b;p=lhc%2Fweb%2Fwiklou.git ws only cleanup --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index c8fc529ff9..cebda0a5cf 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -629,7 +629,7 @@ abstract class ApiBase { // Throw out duplicates if requested if ( is_array( $value ) && !$dupes ) $value = array_unique( $value ); - + // Set a warning if a deprecated parameter has been passed if ( $deprecated ) { $this->setWarning( "The $encParamName parameter has been deprecated." ); diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 04a5f7617c..f4b1b484df 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -104,7 +104,7 @@ class ApiMain extends ApiBase { 'dbg' => 'ApiFormatDbg', 'dbgfm' => 'ApiFormatDbg' ); - + /** * List of user roles that are specifically relevant to the API. * array( 'right' => array ( 'msg' => 'Some message with a $1', @@ -186,12 +186,12 @@ class ApiMain extends ApiBase { } /** - * Get the ApiResult object asscosiated with current request + * Get the ApiResult object associated with current request */ public function getResult() { return $this->mResult; } - + /** * Get the API module object. Only works after executeAction() */ @@ -235,7 +235,7 @@ class ApiMain extends ApiBase { $this->executeAction(); else $this->executeActionWithErrorHandling(); - + $this->profileOut(); } @@ -460,7 +460,7 @@ class ApiMain extends ApiBase { $printer->closePrinter(); $printer->profileOut(); } - + public function isReadMode() { return false; } @@ -576,7 +576,7 @@ class ApiMain extends ApiBase { $wgMemc->set( $key, $retval, $wgAPICacheHelpTimeout ); return $retval; } - + public function reallyMakeHelpMsg() { $this->mPrinter->setHelp(); diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index ac89026f58..c124c02e33 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -70,7 +70,7 @@ class RepoGroup { * * ignoreRedirect: If true, do not follow file redirects * - * private: If true, return restricted (deleted) files if the current + * private: If true, return restricted (deleted) files if the current * user is allowed to view them. Otherwise, such files will not * be found. * @@ -93,9 +93,9 @@ class RepoGroup { } # Check the cache - if ( empty( $options['ignoreRedirect'] ) - && empty( $options['private'] ) - && empty( $options['bypassCache'] ) ) + if ( empty( $options['ignoreRedirect'] ) + && empty( $options['private'] ) + && empty( $options['bypassCache'] ) ) { $useCache = true; $time = isset( $options['time'] ) ? $options['time'] : ''; @@ -164,7 +164,7 @@ class RepoGroup { foreach ( $images as $name => $image ) { unset( $items[$name] ); } - + $images = array_merge( $images, $repo->findFiles( $items ) ); } return $images; @@ -190,16 +190,16 @@ class RepoGroup { } return false; } - + function findBySha1( $hash ) { if ( !$this->reposInitialised ) { $this->initialiseRepos(); } - + $result = $this->localRepo->findBySha1( $hash ); foreach ( $this->foreignRepos as $repo ) $result = array_merge( $result, $repo->findBySha1( $hash ) ); - return $result; + return $result; } /** @@ -240,7 +240,7 @@ class RepoGroup { } /** - * Call a function for each foreign repo, with the repo object as the + * Call a function for each foreign repo, with the repo object as the * first parameter. * * @param $callback callback The function to call diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 026758f45c..067b94fdd5 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -1,18 +1,18 @@ mFileSize = $fileSize; $this->mRemoveTempFile = $removeTempFile; } - + /** * Initialize from a WebRequest. Override this in a subclass. */ @@ -137,7 +137,7 @@ abstract class UploadBase { public function isEmptyFile(){ return empty( $this->mFileSize ); } - + /** * getRealPath * @param string $srcPath the source path @@ -161,7 +161,7 @@ abstract class UploadBase { */ if( $this->isEmptyFile() ) return array( 'status' => self::EMPTY_FILE ); - + /** * Look at the contents of the file; if we can recognize the * type but it's corrupt or data of the wrong type, we should @@ -175,7 +175,7 @@ abstract class UploadBase { 'details' => $verification ); } - + $nt = $this->getTitle(); if( is_null( $nt ) ) { $result = array( 'status' => $this->mTitleError ); @@ -222,7 +222,7 @@ abstract class UploadBase { #check mime type, if desired global $wgVerifyMimeType; - if ( $wgVerifyMimeType ) { + if ( $wgVerifyMimeType ) { global $wgMimeTypeBlacklist; if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) return array( 'filetype-badmime', $mime ); @@ -263,7 +263,7 @@ abstract class UploadBase { /** * Check whether the user can edit, upload and create the image. - * + * * @param User $user the user to verify the permissions against * @return mixed An array as returned by getUserPermissionsErrors or true * in case the user has proper permissions. @@ -289,7 +289,7 @@ abstract class UploadBase { /** * Check for non fatal problems with the file - * + * * @return array Array of warnings */ public function checkWarnings() { @@ -350,9 +350,9 @@ abstract class UploadBase { } /** - * Really perform the upload. Stores the file in the local repo, watches + * Really perform the upload. Stores the file in the local repo, watches * if necessary and runs the UploadComplete hook. - * + * * @return mixed Status indicating the whether the upload succeeded. */ public function performUpload( $comment, $pageText, $watch, $user ) { @@ -372,7 +372,7 @@ abstract class UploadBase { /** * Returns the title of the file to be uploaded. Sets mTitleError in case * the name was illegal. - * + * * @return Title The title of the file or null in case the name was illegal */ public function getTitle() { @@ -441,7 +441,7 @@ abstract class UploadBase { } /** - * Return the local file and initializes if necessary. + * Return the local file and initializes if necessary. */ public function getLocalFile() { if( is_null( $this->mLocalFile ) ) { @@ -491,7 +491,7 @@ abstract class UploadBase { 'mFileSize' => $this->mFileSize, 'mFileProps' => $this->mFileProps, 'version' => self::SESSION_VERSION, - ); + ); return $key; } @@ -883,9 +883,9 @@ abstract class UploadBase { return true; } - /* Check shared conflicts: if the local file does not exist, but - * wfFindFile finds a file, it exists in a shared repository. - */ + /* Check shared conflicts: if the local file does not exist, but + * wfFindFile finds a file, it exists in a shared repository. + */ $file = wfFindFile( $this->getTitle() ); if ( $file && !$wgUser->isAllowed( 'reupload-shared' ) ) return 'fileexists-shared-forbidden'; @@ -915,13 +915,13 @@ abstract class UploadBase { /** * Helper function that does various existence checks for a file. - * The following checks are performed: + * The following checks are performed: * - The file exists * - Article with the same name as the file exists * - File exists with normalized extension * - The file looks like a thumbnail and the original exists - * - * @param File $file The file to check + * + * @param File $file The file to check * @return mixed False if the file does not exists, else an array */ public static function getExistsWarning( $file ) { @@ -930,10 +930,10 @@ abstract class UploadBase { if( $file->getTitle()->getArticleID() ) return array( 'warning' => 'page-exists', 'file' => $file ); - + if ( $file->wasDeleted() && !$file->exists() ) - return array( 'warning' => 'was-deleted', 'file' => $file ); - + return array( 'warning' => 'was-deleted', 'file' => $file ); + if( strpos( $file->getName(), '.' ) == false ) { $partname = $file->getName(); $extension = ''; @@ -967,13 +967,13 @@ abstract class UploadBase { // File does not exist, but we just don't like the name return array( 'warning' => 'thumb-name', 'file' => $file, 'thumbFile' => $file_thb ); } - + foreach( self::getFilenamePrefixBlacklist() as $prefix ) { if ( substr( $partname, 0, strlen( $prefix ) ) == $prefix ) return array( 'warning' => 'bad-prefix', 'file' => $file, 'prefix' => $prefix ); } - + return false;