Last modified: 2007-12-20 00:00:38 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 T14346, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12346 - Error in MonoBook.php creates invalid XML
Error in MonoBook.php creates invalid XML
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.11.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://wiki.education.ucsb.edu
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-18 20:15 UTC by Justin Force
Modified: 2007-12-20 00:00 UTC (History)
3 users (show)

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


Attachments
This is a screenshot of the error generated in Opera. (35.96 KB, image/png)
2007-12-18 20:15 UTC, Justin Force
Details
Correct the issue wherein the lack of a space in the onload attribute of the body tag in skins/MonoBook.php generates invalid XML. (742 bytes, patch)
2007-12-19 18:28 UTC, Justin Force
Details

Description Justin Force 2007-12-18 20:15:38 UTC
Created attachment 4450 [details]
This is a screenshot of the error generated in Opera.

In ./skins/MonoBook.php, a space is missing which causes invalid XML to be rendered. This is a problem for strict browsers like Opera, which then fail to render the page because it is invalid XML. Here's the line:

MonoBook.php:94
<?php if($this->data['body_onload'    ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php } ?>

should be changed to 
<?php if($this->data['body_onload'    ]) { ?> onload="<?php     $this->text('body_onload')     ?>"<?php } ?>

which fixes the problem completely.
Comment 1 Brion Vibber 2007-12-19 00:10:54 UTC
Can reproduce when both "section edit on right-click" and "edit on double-click" preferences are active.

Fixed in r28645
Comment 2 Justin Force 2007-12-19 17:38:08 UTC
I'm at r28671, and the bug is present. Perhaps it was re-introduced?
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-12-19 17:45:22 UTC
I can confirm the fix works correctly for me at HEAD (r28671).  Could you make sure the patch was properly applied to your local copy of MW, and clarify the exact error you're getting?
Comment 4 Justin Force 2007-12-19 18:28:20 UTC
Created attachment 4453 [details]
Correct the issue wherein the lack of a space in the onload attribute of the body tag in skins/MonoBook.php generates invalid XML.

The error is invalid XML rendered at line 62 of the output file which prevents rendering in the Opera web browser. The XML is invalid because there is no space preceding the 'onload' attribute of the body tag, as there should be. The error is most certainly still present in 28672, and was present in 28671 as well (just checked). I'll provide a patch, though it's just the addition of a single space character.
Comment 5 Robert Leverington 2007-12-19 22:22:44 UTC
(In reply to comment #3)
> I can confirm the fix works correctly for me at HEAD (r28671).  Could you make
> sure the patch was properly applied to your local copy of MW, and clarify the
> exact error you're getting?
> 

Is your server definitely serving the PHP files as XML? Normally they are configured to send it as a HTML mime because IE fails at XHTML. If it is set to serve them with an XHTML mime Opera will through errors on invalidity, otherwise AFAIK it won't.
Comment 6 Justin Force 2007-12-19 22:45:08 UTC
In my case, the server is sending Content-type: text/html headers. Opera is examining the document and determining that it is XHTML, then rejecting it as invalid.

...which is not the issue. Follow me here.

The doctype is XHTML.
XHTML is a subset of XML.
Invalid XML is being rendered.
The document is invalid.

This is a bug. 

I have clearly defined it and supplied a patch. There is certainly no downside to applying my fix, and there is the practical benefit of MediaWiki rendering correct XML, being more standards-compliant, and working correctly in the very popular Opera web browser. 

Come on.
Comment 7 Brion Vibber 2007-12-20 00:00:38 UTC
The patch was already applied in r28645; most likely you've got the old generated page in your cache.

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


Navigation
Links