Checking permissions for $wgUser while doing an edit with another user is not a good...
[lhc/web/wiklou.git] / includes / api / ApiQueryFilearchive.php
index e739345..2964dc8 100644 (file)
@@ -1,10 +1,9 @@
 <?php
-
 /**
- * Created on May 10, 2010
- *
  * API for MediaWiki 1.12+
  *
+ * Created on May 10, 2010
+ *
  * Copyright © 2010 Sam Reed
  * Copyright © 2008 Vasiliev Victor vasilvv@gmail.com,
  * based on ApiQueryAllpages.php
@@ -23,6 +22,8 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -47,11 +48,11 @@ class ApiQueryFilearchive extends ApiQueryBase {
                if ( !$wgUser->isAllowed( 'deletedhistory' ) ) {
                        $this->dieUsage( 'You don\'t have permission to view deleted file information', 'permissiondenied' );
                }
-       
+
                $db = $this->getDB();
 
                $params = $this->extractRequestParams();
-               
+
                $prop = array_flip( $params['prop'] );
                $fld_sha1 = isset( $prop['sha1'] );
                $fld_timestamp = isset( $prop['timestamp'] );
@@ -62,9 +63,9 @@ class ApiQueryFilearchive extends ApiQueryBase {
                $fld_mime = isset( $prop['mime'] );
                $fld_metadata = isset( $prop['metadata'] );
                $fld_bitdepth = isset( $prop['bitdepth'] );
-               
+
                $this->addTables( 'filearchive' );
-               
+
                $this->addFields( 'fa_name' );
                $this->addFieldsIf( 'fa_storage_key', $fld_sha1 );
                $this->addFieldsIf( 'fa_timestamp', $fld_timestamp );
@@ -125,7 +126,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                                $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->fa_name ) );
                                break;
                        }
-                       
+
                        $file = array();
                        $file['name'] = $row->fa_name;
 
@@ -157,7 +158,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                        if ( $fld_mime ) {
                                $file['mime'] = "$row->fa_major_mime/$row->fa_minor_mime";
                        }
-                       
+
                        $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $file );
                        if ( !$fit ) {
                                $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->fa_name ) );
@@ -224,7 +225,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                        'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)',
                        'prop' => array(
                                'What image information to get:',
-                               ' sha1         - Adds sha1 hash for the image',
+                               ' sha1         - Adds SHA-1 hash for the image',
                                ' timestamp    - Adds timestamp for the uploaded version',
                                ' user         - Adds user for uploaded the image version',
                                ' size         - Adds the size of the image in bytes',