X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=thumb.php;h=b0d72f3df7e73736b1a01b450b0263ca3b2f93a0;hb=479292b8e1bf9efe386bc9411d161e706827ccdf;hp=362f304b62b07eba5da05b0adde9aa02a638e3b5;hpb=6e930328fa65926c97c7ed14dc53e465f2b8c541;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index 362f304b62..b0d72f3df7 100644 --- a/thumb.php +++ b/thumb.php @@ -343,17 +343,18 @@ function wfExtractThumbParams( $uriPath ) { $params['temp'] = 1; } + // Check hooks if parameters can be extracted + // Hooks return false if they manage to *resolve* the parameters + if ( !wfRunHooks( 'ExtractThumbParameters', array( $thumbname, &$params ) ) ) { + return $params; // valid thumbnail URL (via extension or config) // Check if the parameters can be extracted from the thumbnail name... - if ( preg_match( '!^(page(\d*)-)*(\d*)px-[^/]*$!', $thumbname, $matches ) ) { + } elseif ( preg_match( '!^(page(\d*)-)*(\d*)px-[^/]*$!', $thumbname, $matches ) ) { list( /* all */, $pagefull, $pagenum, $size ) = $matches; $params['width'] = $size; if ( $pagenum ) { $params['page'] = $pagenum; } return $params; // valid thumbnail URL - // Hooks return false if they manage to *resolve* the parameters - } elseif ( !wfRunHooks( 'ExtractThumbParameters', array( $thumbname, &$params ) ) ) { - return $params; // valid thumbnail URL (via extension or config) } return null; // not a valid thumbnail URL