From: Aaron Schulz Date: Fri, 28 Oct 2011 19:50:25 +0000 (+0000) Subject: FU r101117: X-Git-Tag: 1.31.0-rc.0~26841 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=87382f33808f5ad4bf8fb6a4a07ef6e1a775e7cc;p=lhc%2Fweb%2Fwiklou.git FU r101117: * Moved 'checkCache' callback to cURL function as the 'fillCache' function is only ever called from that function --- diff --git a/thumb_handler.php b/thumb_handler.php index 0f7d1af263..073a87929e 100644 --- a/thumb_handler.php +++ b/thumb_handler.php @@ -49,15 +49,6 @@ function wfHandleThumb404Main() { return; } - # Check any backend caches for the thumbnail... - if ( isset( $thgThumbCallbacks['checkCache'] ) - && is_callable( $thgThumbCallbacks['checkCache'] ) ) - { - if ( call_user_func_array( $thgThumbCallbacks['checkCache'], array( $uri, $params ) ) ) { - return; // file streamed from backend thumb cache - } - } - # Obtain and stream the thumbnail or setup for wfThumbMain() call... if ( $thgThumbCurlConfig['enabled'] ) { wfStreamThumbViaCurl( $params, $uri ); @@ -110,6 +101,15 @@ function wfExtractThumbParams( $uri ) { function wfStreamThumbViaCurl( array $params, $uri ) { global $thgThumbCallbacks, $thgThumbCurlConfig; + # Check any backend caches for the thumbnail... + if ( isset( $thgThumbCallbacks['checkCache'] ) + && is_callable( $thgThumbCallbacks['checkCache'] ) ) + { + if ( call_user_func_array( $thgThumbCallbacks['checkCache'], array( $uri, $params ) ) ) { + return; // file streamed from backend thumb cache + } + } + if ( !extension_loaded( 'curl' ) ) { die( "cURL is not enabled for PHP on this wiki.\n" ); // sanity }