From 083d47cc734e8332177f10a4ca583dfe74133253 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Fri, 9 Mar 2012 18:32:03 +0000 Subject: [PATCH] (bug 23795) Add parser itself to ParserMakeImageParams hook. --- RELEASE-NOTES-1.20 | 1 + docs/hooks.txt | 1 + includes/parser/Parser.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 1172f878bd..afa814d980 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -23,6 +23,7 @@ production. * (bug 34896) Update jQuery JSON plugin to v2.3 (2011-09-17) * (bug 34302) Add CSS classes to email fields in user preferences * Introduced $wgDebugDBTransactions to trace transaction status (currently PostgreSQL only) +* (bug 23795) Add parser itself to ParserMakeImageParams hook. === Bug fixes in 1.20 === * (bug 30245) Use the correct way to construct a log page title. diff --git a/docs/hooks.txt b/docs/hooks.txt index e9acbf8b10..eb235d69a7 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1478,6 +1478,7 @@ to modify the parameters of the image. $title: title object representing the file $file: file object that will be used to create the image &$params: 2-D array of parameters +$parser: Parser object that called the hook 'ParserSectionCreate': Called each time the parser creates a document section from wikitext. Use this to apply per-section modifications to HTML (like diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 1be509c89c..3dff643062 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5117,7 +5117,7 @@ class Parser { $params['frame']['title'] = $this->stripAltText( $caption, $holders ); } - wfRunHooks( 'ParserMakeImageParams', array( $title, $file, &$params ) ); + wfRunHooks( 'ParserMakeImageParams', array( $title, $file, &$params, $this ) ); # Linker does the rest $time = isset( $options['time'] ) ? $options['time'] : false; -- 2.20.1