Anomie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354503 )

Change subject: Use canonical ParserOptions for WikiPage::getParserOutput()
......................................................................

Use canonical ParserOptions for WikiPage::getParserOutput()

As it is, this could pollute parser caches with a version lacking tidy
and the limit report if it's not already cached. MediaWiki core change
I7fb9ffca9 is going to make that be an error.

Bug: T110269
Change-Id: I4070a8f51927121f690469716625db4a1064dea5
---
M includes/Hooks.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData 
refs/changes/03/354503/1

diff --git a/includes/Hooks.php b/includes/Hooks.php
index f7ca72a..09e8255 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -210,8 +210,10 @@
         * @param LocalFile $file
         */
        public static function onFileUpload( LocalFile $file ) {
+               global $wgUser;
+
                $wp = WikiPage::factory( $file->getTitle() );
-               $po = new ParserOptions();
+               $po = $wp->makeParserOptions( $wgUser );
                $pout = $wp->getParserOutput( $po );
                if ( !$pout ) {
                        wfDebugLog( 'mobile', __METHOD__ . "(): no parser 
output returned for file {$file->getName()}" );

-- 
To view, visit https://gerrit.wikimedia.org/r/354503
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4070a8f51927121f690469716625db4a1064dea5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to