Merge "Pass $parser, &$query and &$widthOption to the 'ImageBeforeProduceHTML' hook"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 13 Jun 2018 15:31:01 +0000 (15:31 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 13 Jun 2018 15:31:01 +0000 (15:31 +0000)
RELEASE-NOTES-1.32
docs/hooks.txt
includes/Linker.php

index 36e1f35..aa671d2 100644 (file)
@@ -42,6 +42,9 @@ production.
   reauthenticating.
 * FormSpecialPage::execute() will now call checkLoginSecurityLevel() if
   getLoginSecurityLevel() returns non-false.
+* The 'ImageBeforeProduceHTML' hook is now passed three new parameters, $parser,
+  &$query and &$widthOption, allowing extensions even finer control over the resulting
+  HTML code.
 
 === External library changes in 1.32 ===
 * …
index fcd3e07..48b76bb 100644 (file)
@@ -1835,6 +1835,9 @@ just modify a few things using call-by-reference.
   includes/Linker.php for Linker::makeImageLink
 &$time: Timestamp of file in 'YYYYMMDDHHIISS' string form, or false for current
 &$res: Final HTML output, used if you return false
+$parser: Parser instance
+&$query: Query params for desc URL
+&$widthOption: Used by the parser to remember the user preference thumbnailsize
 
 'ImageOpenShowImageInlineBefore': Call potential extension just before showing
 the image on an image page.
index ec61984..89a6a10 100644 (file)
@@ -305,7 +305,9 @@ class Linker {
                $res = null;
                $dummy = new DummyLinker;
                if ( !Hooks::run( 'ImageBeforeProduceHTML', [ &$dummy, &$title,
-                       &$file, &$frameParams, &$handlerParams, &$time, &$res ] ) ) {
+                       &$file, &$frameParams, &$handlerParams, &$time, &$res,
+                       $parser, &$query, &$widthOption
+               ] ) ) {
                        return $res;
                }