aboutsummaryrefslogtreecommitdiffstats
path: root/thumb.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2013-11-12 14:57:22 +1100
committerTim Starling <tstarling@wikimedia.org>2013-11-12 14:57:22 +1100
commit0dd1a446c856e5d9bc260d01c1f7662364a0f3ea (patch)
tree4a8d697693f87694119a61efad4b41d0bef852d1 /thumb.php
parent454b21318deced7e26fb7b1e0efa9b2e45800034 (diff)
downloadmediawikicore-0dd1a446c856e5d9bc260d01c1f7662364a0f3ea.tar.gz
mediawikicore-0dd1a446c856e5d9bc260d01c1f7662364a0f3ea.zip
thumb.php: map b/c params prior to attempting redirection
This should fix most of the "No width specified" exceptions. I guess most of this code will be rewritten to fix bug 56926, superseding this patch, but I thought this might be a useful stopgap. Bug: 56924 Change-Id: I5bcaaafc81e1e2a8a33819fa64790d5509dc6aa6
Diffstat (limited to 'thumb.php')
-rw-r--r--thumb.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/thumb.php b/thumb.php
index 913adc18ecb1..35ab9f27e622 100644
--- a/thumb.php
+++ b/thumb.php
@@ -107,6 +107,15 @@ function wfStreamThumb( array $params ) {
$fileName = isset( $params['f'] ) ? $params['f'] : '';
+ // Backwards compatibility parameters
+ if ( isset( $params['w'] ) ) {
+ $params['width'] = $params['w'];
+ unset( $params['w'] );
+ }
+ if ( isset( $params['p'] ) ) {
+ $params['page'] = $params['p'];
+ }
+
// Is this a thumb of an archived file?
$isOld = ( isset( $params['archived'] ) && $params['archived'] );
unset( $params['archived'] ); // handlers don't care
@@ -235,14 +244,6 @@ function wfStreamThumb( array $params ) {
}
}
- // Backwards compatibility parameters
- if ( isset( $params['w'] ) ) {
- $params['width'] = $params['w'];
- unset( $params['w'] );
- }
- if ( isset( $params['p'] ) ) {
- $params['page'] = $params['p'];
- }
unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER
unset( $params['f'] ); // We're done with 'f' parameter.