Last modified: 2011-03-13 18:06:28 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 T10775, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8775 - ctype=text/plain
ctype=text/plain
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.9.x
PC Linux
: Lowest minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-25 19:14 UTC by Dan Jacobson
Modified: 2011-03-13 18:06 UTC (History)
0 users

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


Attachments

Description Dan Jacobson 2007-01-25 19:14:49 UTC
http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Raw says

ctype
    the content-type value to be used in the HTTP header when
    returning the raw content, instead of the default text/x-wiki;
    this can only be one of the allowed types, which currently are
    text/x-wiki, text/javascript, text/css, and
    application/x-zope-edit

What is wrong with adding text/plain to the allowed types? You must
admit that would be the most reasonable choice to be able to read raw
wikitext in some browsers.
Comment 1 Brion Vibber 2007-01-25 20:41:28 UTC
text/plain is unsafe, as a number of browsers interpret it as "go ahead and try
to detect the file type and if it looks like HTML render it as HTML". Hence,
arbitrary JavaScript execution.

You may thank Microsoft and Apple for that.
Comment 2 Jim R. Wilson 2007-02-24 21:35:30 UTC
If you're feeling hackish, 'text/css' offers a dirty alternative.  All major
browsers render text/css just like text/plain (as of the time of this writing).

So instead of linking to "?title=Some_Page&action=raw", try
"?title=Some_Page&action=raw&ctype=text/css"

At least it'll stay in-browser and not prompt you to download the thing.

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


Navigation
Links