Last modified: 2011-04-14 15:11:29 UTC
When viewing pages with action=render, style and image URLs are not properly expanded (i.e., transformed from "$wgStylePath/..." to "$wgServer$wgStylePath/...". Some affected places: * Article::viewRedirect() * EnhancedChangesList::arrow() * Linker::makeThumbLink2() * TablePager::getStartBody() * TablePager::getNavigationBar() I suppressed from this list uses of $wgStylePath that shouldn't happen during action=render (i.e. skin displaying). The easiest solution seems to be to rewrite $wgStylePath during startup, like this: global $wgStylePath, $wgRequest; if ( $wgRequest->getVal( 'action' ) == 'render' ) { $wgStylePath = wfExpandUrl( $wgStylePath ); } It seems to work fine, as far as I tested (I'm casting this from inside an extension). It is as ugly as the workaround currently (as of 1.14-svn) found in Title::getLocalUrl() for the same purpose, but it works. Some better solution is demanded, sniffing into request vars is ugly at best.
Update: I'm currently using this "fix": # Work around bug in MediaWiki 1.13 when '?action=render'. # https://bugzilla.wikimedia.org/show_bug.cgi?id=15512 global $wgRequest, $wgScriptPath, $wgUploadPath; global $wgStylePath, $wgMathPath, $wgLocalFileRepo; if ( $wgRequest->getVal( 'action' ) == 'render' ) { $wgScriptPath = wfExpandUrl( $wgScriptPath ); $wgUploadPath = wfExpandUrl( $wgUploadPath ); $wgStylePath = wfExpandUrl( $wgStylePath ); $wgMathPath = wfExpandUrl( $wgMathPath ); $wgLocalFileRepo['url'] = wfExpandUrl( $wgLocalFileRepo['url'] ); } It also "fixes" bug 9355.