Last modified: 2013-04-08 11:01:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31088, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29088 - New "Nice URL" in Title->getLocalURL breaks action=raw
New "Nice URL" in Title->getLocalURL breaks action=raw
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.18.x
All All
: High major (vote)
: 1.18.0 release
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-22 10:40 UTC by Krinkle
Modified: 2013-04-08 11:01 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2011-05-22 10:40:08 UTC
Extensions such as SyntaxHighlight[1] currently break on a default install. It tries to load titleMediaWiki:Geshi.css, with a querystring that contains action=raw, and calls ->getLocalURL($q) to get the URL.

This is causing MW to throw a 403 error on that http request.


--
Krinkle

[1] http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
Comment 1 Krinkle 2011-05-22 10:49:30 UTC
403 Forbidden:

http://localhost/SVN/mediawiki/trunk/phase3/index.php/MediaWiki:Geshi.css?usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000


PHP Code (abstracted):

private static function buildHeadItem( $geshi ) {

	// ...

	$title = Title::makeTitle( NS_MEDIAWIKI, 'Geshi.css' );
	$q = "usemsgcache=yes&action=raw&ctype=text/css";
	$css[] = '<style type="text/css">/*<![CDATA[*/';
	$css[] = '@import "' . $title->getLocalUrl( $q ) . '";';
	$css[] = '/*]]>*/';
	$css[] = '</style>';

	return implode( "\n", $css );
}

This is likely not the only extension doing this.
Comment 2 Krinkle 2011-05-22 21:34:48 UTC
CC-ing hashar who implemented this (iirc).
Comment 3 Krinkle 2011-05-22 21:36:22 UTC
Adding blocker to bug 28425 (1.18 Milestone), we can't ship 1.18 without this as many extensions (including parts of SyntaxHighlighter) would fail.
Comment 4 Antoine "hashar" Musso (WMF) 2011-05-23 06:23:38 UTC
I have rewrote it in r87964 to get prettier URLs.

Self notes: the issue is related to the file extension (.css), the error is:

403 - Forbidden

Invalid file extension found in PATH_INFO or QUERY_STRING. Raw pages must be accessed through the primary script entry point.


Not sure what is the root cause, will try to poke it next week-end.
Comment 5 Bawolff (Brian Wolff) 2011-05-23 06:26:43 UTC
>Not sure what is the root cause, will try to poke it next week-end.

I believe ?action=raw must happen with index.php style links only, as opposed to short urls due to the IE6 XSS issue.
Comment 6 Brion Vibber 2011-05-23 19:57:53 UTC
I've reverted r87964 in r88667, which'll make this bug obsolete.

Note that action=raw specifically forbids use of PATHINFO-style title appending because it's a security problem on IE 6.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links