Page MenuHomePhabricator

Closing commented text at the beginning of a line (due to ModSecurity configuration)
Closed, InvalidPublic

Description

If the first three characters on a line are --> doing Show preview takes the browser to a 400 Bad Request page. On MediaWiki MediaWiki 1.21.1 and PHP 5.3.22 (cgi-fcgi).


Version: 1.21.x
Severity: minor
Whiteboard: aklapper-moreinfo

Details

Reference
bz49273

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:57 AM
bzimport set Reference to bz49273.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for taking the time to report this!

I've tried on https://test2.wikipedia.org/wiki/Bug49273 and cannot reproduce the problem. Do you have a specific testcase? Is this on a publicly accessible Mediawiki installation (URL?)?

Confirming with account testing1 (password is the same without the 1) on http://www.sdiy.info/w/index.php?title=Foo&action=submit

JAVASCRIPT CONSOLE OUTPUT:
Error: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
Source File: http://www.sdiy.info/w/index.php?title=Foo&action=submit
Line: 0

Could you please check your PHP error log? See http://www.mediawiki.org/wiki/Manual:How_to_debug
Also see explanation in http://stackoverflow.com/questions/11633162/character-encoding-not-declared-in-html-document why this potentially happens.

There is no entry in the PHP error log for when it happens.

Turns out it only needs -- at the start of a line.

The site host tells me it was caused by ModSecurity.

Ah, thanks for sharing the reason, and glad you found out!
Closing as INVALID here as there's not much that can be done about it in the MediaWiki code.