Santosh2201 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/118822

Change subject: thumb.php should output docs if no file specified
......................................................................

thumb.php should output docs if no file specified

If the fileName parameter('f') is not specified,it should output error with
the parameters needed to be passed. The comments(parameters) specified above
function wfStreamThumb() are displayed in a list manner.

Bug: 54749
Change-Id: I8407017948b2e3392e0d5f1cbe8b2d01b52d96d3
---
M thumb.php
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/118822/1

diff --git a/thumb.php b/thumb.php
index 88aecbd..bfd062f 100644
--- a/thumb.php
+++ b/thumb.php
@@ -107,6 +107,22 @@
 
        $fileName = isset( $params['f'] ) ? $params['f'] : '';
 
+       //Output parameters if no file specified
+       if ( $fileName == null) {
+         wfThumbError('400','<p>This page takes following input as 
parameters:</p>'.
+         '<ul><li>f (for filename)</li>'.
+         '<li>archived (if archived file)</li>'.
+         '<li>temp (if temp file)</li>'.
+                '<li>w (alias for width)</li>'.
+                '<li> p (alias for page)</li>'.
+                '<li>r (ignored; historical)'.
+                '<li>rel404 (path for render on 404 to verify hash path 
correct)</li>'.
+                '<li>thumbName (thumbnail name to potentially extract more 
parameters from '.
+                "e.g. 'lossy-page1-120px-Foo.tiff' would add page, lossy and 
width ".
+                'to the parameters)</li></ul>');
+         return;
+    }  
+       
        // Backwards compatibility parameters
        if ( isset( $params['w'] ) ) {
                $params['width'] = $params['w'];

-- 
To view, visit https://gerrit.wikimedia.org/r/118822
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8407017948b2e3392e0d5f1cbe8b2d01b52d96d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Santosh2201 <santosh.cool.re...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to