aboutsummaryrefslogtreecommitdiffstats
path: root/includes/OutputPage.php
diff options
context:
space:
mode:
authorTimo Tijhof <krinklemail@gmail.com>2016-08-16 15:25:08 -0700
committerTimo Tijhof <krinklemail@gmail.com>2016-08-16 15:56:02 -0700
commit4ed96c1dde5ea1afa12355590de7d01ab23151e6 (patch)
treeffbf6ec720f97ba0d583498e67f529b9e0b831dc /includes/OutputPage.php
parent940c1e1089943649a8dad11cd6ef7aab65b02731 (diff)
downloadmediawikicore-4ed96c1dde5ea1afa12355590de7d01ab23151e6.tar.gz
mediawikicore-4ed96c1dde5ea1afa12355590de7d01ab23151e6.zip
OutputPage: Apply target and origin filter to exempt modules
Follows-up 80e5b160e, which moved filter logic to getRlClient() so that ResourceLoaderClientHtml doesn't have to deal with this. While that worked fine for most modules (including 'site'), it no longer applied the filter for exempt/hardcoded modules (such as 'site.styles' and 'startup'). Bug: T143066 Change-Id: Iec924003873bc47484a0dc2f1a215f87aa4afdfb
Diffstat (limited to 'includes/OutputPage.php')
-rw-r--r--includes/OutputPage.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index cc377bc6ea5f..f5a37d460a05 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2671,7 +2671,7 @@ class OutputPage extends ContextSource {
'user.options',
'user.tokens',
] );
- $rlClient = new ResourceLoaderClientHtml( $context );
+ $rlClient = new ResourceLoaderClientHtml( $context, $this->getTarget() );
$rlClient->setConfig( $this->getJSVars() );
$rlClient->setModules( $this->getModules( /*filter*/ true ) );
$rlClient->setModuleStyles( $this->getModuleStyles( /*filter*/ true ) );
@@ -2790,9 +2790,12 @@ class OutputPage extends ContextSource {
* @return string|WrappedStringList HTML
*/
public function makeResourceLoaderLink( $modules, $only, array $extraQuery = [] ) {
+ // Apply 'target' and 'origin' filters
+ $modules = $this->filterModules( (array)$modules, null, $only );
+
return ResourceLoaderClientHtml::makeLoad(
$this->getRlClientContext(),
- (array)$modules,
+ $modules,
$only,
$extraQuery
);