Merge "Use Database::addQuotes in Special:WantedPages/UnwatchedPages"
[lhc/web/wiklou.git] / includes / api / ApiExpandTemplates.php
index 6611a09..10fb182 100644 (file)
@@ -34,7 +34,7 @@
 class ApiExpandTemplates extends ApiBase {
 
        public function execute() {
-               // Cache may vary on $wgUser because ParserOptions gets data from it
+               // Cache may vary on the user because ParserOptions gets data from it
                $this->getMain()->setCacheMode( 'anon-public-user-private' );
 
                // Get parameters
@@ -77,6 +77,11 @@ class ApiExpandTemplates extends ApiBase {
                        $options->setRemoveComments( false );
                }
 
+               $reset = null;
+               $suppressCache = false;
+               Hooks::run( 'ApiMakeParserOptions',
+                       [ $options, $title_obj, $params, $this, &$reset, &$suppressCache ] );
+
                $retval = [];
 
                if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) {
@@ -158,7 +163,7 @@ class ApiExpandTemplates extends ApiBase {
                                        !isset( $prop['jsconfigvars'] ) && !isset( $prop['encodedjsconfigvars'] ) ) {
                                        $this->setWarning( "Property 'modules' was set but not 'jsconfigvars' " .
                                                "or 'encodedjsconfigvars'. Configuration variables are necessary " .
-                                               "for proper module usage." );
+                                               'for proper module usage.' );
                                }
                        }
                }