(bug 23795) Add parser itself to ParserMakeImageParams hook.
authorMax Semenik <maxsem@users.mediawiki.org>
Fri, 9 Mar 2012 18:32:03 +0000 (18:32 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Fri, 9 Mar 2012 18:32:03 +0000 (18:32 +0000)
RELEASE-NOTES-1.20
docs/hooks.txt
includes/parser/Parser.php

index 1172f87..afa814d 100644 (file)
@@ -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.
index e9acbf8..eb235d6 100644 (file)
@@ -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
index 1be509c..3dff643 100644 (file)
@@ -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;