Index: trunk/phase3/includes/specials/SpecialUploadStash.php |
— | — | @@ -210,12 +210,20 @@ |
211 | 211 | // this global probably looks something like 'http://upload.wikimedia.org/wikipedia/test/thumb/temp' |
212 | 212 | // do not use trailing slash |
213 | 213 | global $wgUploadStashScalerBaseUrl; |
| 214 | + $scalerBaseUrl = $wgUploadStashScalerBaseUrl; |
| 215 | + |
| 216 | + if( preg_match( '/^\/\//', $scalerBaseUrl ) ) { |
| 217 | + // this is apparently a protocol-relative URL, which makes no sense in this context, |
| 218 | + // since this is used for communication that's internal to the application. |
| 219 | + // default to http. |
| 220 | + $scalerBaseUrl = 'http:' . $scalerBaseUrl; |
| 221 | + } |
214 | 222 | |
215 | 223 | // We need to use generateThumbName() instead of thumbName(), because |
216 | 224 | // the suffix needs to match the file name for the remote thumbnailer |
217 | 225 | // to work |
218 | 226 | $scalerThumbName = $file->generateThumbName( $file->getName(), $params ); |
219 | | - $scalerThumbUrl = $wgUploadStashScalerBaseUrl . '/' . $file->getUrlRel() . |
| 227 | + $scalerThumbUrl = $scalerBaseUrl . '/' . $file->getUrlRel() . |
220 | 228 | '/' . rawurlencode( $scalerThumbName ); |
221 | 229 | |
222 | 230 | // make a curl call to the scaler to create a thumbnail |