http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82820

Revision: 82820
Author:   reedy
Date:     2011-02-25 21:46:45 +0000 (Fri, 25 Feb 2011)
Log Message:
-----------
MFT r82810, r82813, r82814, r82815, r82818

Modified Paths:
--------------
    branches/wmf/1.17wmf1/RELEASE-NOTES
    branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php

Property Changed:
----------------
    branches/wmf/1.17wmf1/RELEASE-NOTES
    branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php

Modified: branches/wmf/1.17wmf1/RELEASE-NOTES
===================================================================
--- branches/wmf/1.17wmf1/RELEASE-NOTES 2011-02-25 21:45:18 UTC (rev 82819)
+++ branches/wmf/1.17wmf1/RELEASE-NOTES 2011-02-25 21:46:45 UTC (rev 82820)
@@ -502,6 +502,7 @@
 * (bug 27201) Special:WhatLinksHere output no longer contains duplicate IDs
 * (bug 27479) API error when using both prop=pageprops and
   prop=info&inprop=displaytitle
+* (bug 27715) imageinfo didn't respect revdelete
 
 * (bug 22738) Allow filtering by action type on query=logevent.
 * (bug 22764) uselang parameter for action=parse.


Property changes on: branches/wmf/1.17wmf1/RELEASE-NOTES
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/RELEASE-NOTES:51646
/branches/REL1_17/extensions/RELEASE-NOTES:81654
/branches/REL1_17/phase3/RELEASE-NOTES:81654
/branches/new-installer/phase3/RELEASE-NOTES:43664-66004
/branches/sqlite/RELEASE-NOTES:58211-58321
/branches/wmf/1.16wmf4/RELEASE-NOTES:67177,69199,76243,77266
/branches/wmf-deployment/RELEASE-NOTES:60970
/trunk/extensions/RELEASE-NOTES:78893,78897,78909,82404
/trunk/phase3/HISTORY:79860,80620
/trunk/phase3/RELEASE-NOTES:78893,78897,78909,79166,79324,79454-79456,79536,79727,79733,79746,79773-79774,80109,80113,80163,80222-80223,80322,80324,80326,80328,80339,80350-80351,80355,80358,80362-80363,80371,80442,80475,80492,80495,80540,80554,80575,80608,80620,80656,80666,80679,80685,80694,80728,80765,80841,81121,81124,81177,81186-81187,81197,81209-81211,81215,81238,81246,81262,81264,81430,81488,81496,81554,81561,81589,81600,81611,81620,81622,81640,81648,81650-81652,82000,82155-82156,82191,82200,82203,82218,82297,82312,82337,82404,82408-82409,82453,82456-82458,82460,82465,82473-82474,82478,82482,82486,82513,82518,82530,82572,82608
   + /branches/REL1_15/phase3/RELEASE-NOTES:51646
/branches/REL1_17/extensions/RELEASE-NOTES:81654
/branches/REL1_17/phase3/RELEASE-NOTES:81654
/branches/new-installer/phase3/RELEASE-NOTES:43664-66004
/branches/sqlite/RELEASE-NOTES:58211-58321
/branches/wmf/1.16wmf4/RELEASE-NOTES:67177,69199,76243,77266
/branches/wmf-deployment/RELEASE-NOTES:60970
/trunk/extensions/RELEASE-NOTES:78893,78897,78909,82404
/trunk/phase3/HISTORY:79860,80620
/trunk/phase3/RELEASE-NOTES:78893,78897,78909,79166,79324,79454-79456,79536,79727,79733,79746,79773-79774,80109,80113,80163,80222-80223,80322,80324,80326,80328,80339,80350-80351,80355,80358,80362-80363,80371,80442,80475,80492,80495,80540,80554,80575,80608,80620,80656,80666,80679,80685,80694,80728,80765,80841,81121,81124,81177,81186-81187,81197,81209-81211,81215,81238,81246,81262,81264,81430,81488,81496,81554,81561,81589,81600,81611,81620,81622,81640,81648,81650-81652,82000,82155-82156,82191,82200,82203,82218,82297,82312,82337,82404,82408-82409,82453,82456-82458,82460,82465,82473-82474,82478,82482,82486,82513,82518,82530,82572,82608,82810,82813-82815,82818

Modified: branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php
===================================================================
--- branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php    2011-02-25 
21:45:18 UTC (rev 82819)
+++ branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php    2011-02-25 
21:46:45 UTC (rev 82820)
@@ -211,21 +211,33 @@
         */
        static function getInfo( $file, $prop, $result, $scale = null ) {
                $vals = array();
+               // Timestamp is shown even if the file is revdelete'd in 
interface
+               // so do same here.
                if ( isset( $prop['timestamp'] ) ) {
                        $vals['timestamp'] = wfTimestamp( TS_ISO_8601, 
$file->getTimestamp() );
                }
-               if ( isset( $prop['user'] ) || isset( $prop['userid'] ) ) {
 
-                       if ( isset( $prop['user'] ) ) {
-                               $vals['user'] = $file->getUser();
+               $user = isset( $prop['user'] );
+               $userid = isset( $prop['userid'] );
+
+               if ( $user || $userid ) {
+                       if ( $file->isDeleted( File::DELETED_USER ) ) {
+                               $vals['userhidden'] = '';
+                       } else {
+                               if ( $user ) {
+                                       $vals['user'] = $file->getUser();
+                               }
+                               if ( $userid ) {
+                                       $vals['userid'] = $file->getUser( 'id' 
);
+                               }
+                               if ( !$file->getUser( 'id' ) ) {
+                                       $vals['anon'] = '';
+                               }
                        }
-                       if ( isset( $prop['userid'] ) ) {
-                               $vals['userid'] = $file->getUser( 'id' );
-                       }
-                       if ( !$file->getUser( 'id' ) ) {
-                               $vals['anon'] = '';
-                       }
                }
+
+               // This is shown even if the file is revdelete'd in interface
+               // so do same here.
                if ( isset( $prop['size'] ) || isset( $prop['dimensions'] ) ) {
                        $vals['size'] = intval( $file->getSize() );
                        $vals['width'] = intval( $file->getWidth() );
@@ -236,9 +248,43 @@
                                $vals['pagecount'] = $pageCount;
                        }
                }
-               if ( isset( $prop['url'] ) ) {
-                       if ( !is_null( $scale ) && !$file->isOld() ) {
-                               $mto = $file->transform( array( 'width' => 
$scale['width'], 'height' => $scale['height'] ) );
+
+               $pcomment = isset( $prop['parsedcomment'] );
+               $comment = isset( $prop['comment'] );
+
+               if ( $pcomment || $comment ) {
+                       if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
+                               $vals['commenthidden'] = '';
+                       } else {
+                               if ( $pcomment ) {
+                                       global $wgUser;
+                                       $vals['parsedcomment'] = 
$wgUser->getSkin()->formatComment(
+                                               $file->getDescription(), 
$file->getTitle() );
+                               }
+                               if ( $comment ) {
+                                       $vals['comment'] = 
$file->getDescription();
+                               }
+                       }
+               }
+
+               $url = isset( $prop['url'] );
+               $sha1 = isset( $prop['sha1'] );
+               $meta = isset( $prop['metadata'] );
+               $mime = isset( $prop['mime'] );
+               $archive = isset( $prop['archivename'] );
+               $bitdepth = isset( $prop['bitdepth'] );
+
+               if ( ( $url || $sha1 || $meta || $mime || $archive || $bitdepth 
)
+                               && $file->isDeleted( File::DELETED_FILE ) ) {
+                       $vals['filehidden'] = '';
+
+                       //Early return, tidier than indenting all following 
things one level
+                       return $vals;
+               }
+
+               if ( $url ) {
+                       if ( !is_null( $thumbParams ) ) {
+                               $mto = $file->transform( $thumbParams );
                                if ( $mto && !$mto->isError() ) {
                                        $vals['thumburl'] = wfExpandUrl( 
$mto->getUrl() );
 
@@ -256,36 +302,32 @@
                                                $thumbFile = 
UnregisteredLocalFile::newFromPath( $mto->getPath(), false );
                                                $vals['thumbmime'] = 
$thumbFile->getMimeType();
                                        }
+                               } else if ( $mto && $mto->isError() ) {
+                                       $vals['thumberror'] = $mto->toText();
                                }
                        }
                        $vals['url'] = $file->getFullURL();
                        $vals['descriptionurl'] = wfExpandUrl( 
$file->getDescriptionUrl() );
                }
-               if ( isset( $prop['comment'] ) ) {
-                       $vals['comment'] = $file->getDescription();
-               }
-               if ( isset( $prop['parsedcomment'] ) ) {
-                       global $wgUser;
-                       $vals['parsedcomment'] = 
$wgUser->getSkin()->formatComment( 
-                                       $file->getDescription(), 
$file->getTitle() );
-               }
                
-               if ( isset( $prop['sha1'] ) ) {
+               if ( $sha1 ) {
                        $vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 
16, 40 );
                }
-               if ( isset( $prop['metadata'] ) ) {
+
+               if ( $meta ) {
                        $metadata = $file->getMetadata();
                        $vals['metadata'] = $metadata ? self::processMetaData( 
unserialize( $metadata ), $result ) : null;
                }
-               if ( isset( $prop['mime'] ) ) {
+
+               if ( $mime ) {
                        $vals['mime'] = $file->getMimeType();
                }
 
-               if ( isset( $prop['archivename'] ) && $file->isOld() ) {
+               if ( $archive && $file->isOld() ) {
                        $vals['archivename'] = $file->getArchiveName();
                }
 
-               if ( isset( $prop['bitdepth'] ) ) {
+               if ( $bitdepth ) {
                        $vals['bitdepth'] = $file->getBitDepth();
                }
 


Property changes on: branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/api/ApiQueryImageInfo.php:51646
/branches/REL1_16/phase3/includes/api/ApiQueryImageInfo.php:63621-63636,69357
/branches/sqlite/includes/api/ApiQueryImageInfo.php:58211-58321
/branches/uploadwizard/phase3/includes/api/ApiQueryImageInfo.php:73550-75905
/branches/wmf/1.16wmf4/includes/api/ApiQueryImageInfo.php:67177,69199,69521,76243,77266
/branches/wmf-deployment/includes/api/ApiQueryImageInfo.php:53381,59952,60970
   + /branches/REL1_15/phase3/includes/api/ApiQueryImageInfo.php:51646
/branches/REL1_16/phase3/includes/api/ApiQueryImageInfo.php:63621-63636,69357
/branches/sqlite/includes/api/ApiQueryImageInfo.php:58211-58321
/branches/uploadwizard/phase3/includes/api/ApiQueryImageInfo.php:73550-75905
/branches/wmf/1.16wmf4/includes/api/ApiQueryImageInfo.php:67177,69199,69521,76243,77266
/branches/wmf-deployment/includes/api/ApiQueryImageInfo.php:53381,59952,60970
/trunk/phase3/includes/api/ApiQueryImageInfo.php:82810,82813-82815,82818


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to