Page MenuHomePhabricator

$wgOut->addExtensionStyle() seems broken
Closed, DeclinedPublic

Description

Author: happy.melon.wiki

Description:
Extension stylesheets are found in the path_to_mw/extensions/ExtensionName/ directory, not path_to_mw/skins/ like core stylesheets. Hence the provision of two separate worker functions in wgOut, addStyle() and addExtensionStyle(). However, they appear to then go through the same mangle and the extension styles still end up with both the path_to_mw/skins/ directory prefix, and the $wgStyleVersion suffix, that are added to core styles. Something's not right there.


Version: 1.16.x
Severity: normal

Details

Reference
bz19943

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:38 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz19943.
bzimport added a subscriber: Unknown Object (MLST).

Seems ok to me. As long as extensions are passing their path as either a full URL (with protocol) or relative from the docroot (ie /extensions/MyExt/whatever.css) they should be fine (see line 1941 on HEAD, r53780). Only if the style relative from the current location (ie: MyExt/whatever.css) will it fail, because then styleLink() goes ahead and adds all the stuff you mention, including $wgStylePath.

Checked all extensions in MW SVN that call this, and they all seem to be ok, if they aren't those are individual bugs.

WORKSFORME, no real issue with addExtensionStyle() here.

happy.melon.wiki wrote:

Document OutputPage::addExtensionStyle()

Ah, I see. Needs documenting, then; here's a suggestion.

Attached: