From 87382f33808f5ad4bf8fb6a4a07ef6e1a775e7cc Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 28 Oct 2011 19:50:25 +0000 Subject: [PATCH] FU r101117: * Moved 'checkCache' callback to cURL function as the 'fillCache' function is only ever called from that function --- thumb_handler.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 } -- 2.20.1