Last modified: 2007-06-20 07:08:30 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 T12009, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10009 - Sidebar can generate invalid HTML
Sidebar can generate invalid HTML
Status: RESOLVED DUPLICATE of bug 9338
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 4515
  Show dependency treegraph
 
Reported: 2007-05-22 22:09 UTC by Michael Daly
Modified: 2007-06-20 07:08 UTC (History)
0 users

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


Attachments

Description Michael Daly 2007-05-22 22:09:10 UTC
If one enters a heading in Mediawiki:Sidebar with an embedded blank, the resulting HTML is not valid.

Example:

Mediawiki:Sidebar contains:

* recent changes
** recentchanges-url|recentchanges

Output is:

<div class='portlet' id='p-recent changes'>  

The blank in the id is not valid.

At a minimum, in various /skins/skinname.php files, the second line of the following code should be changed from:

  <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
    <div class='portlet' id='p-<?php echo htmlspecialchars($bar); ?>'>
to:

  <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
    <div class='portlet' id='p-<?php echo str_replace( ' ', '_', htmlspecialchars($bar) ); ?>'>

It may be necessary, in general, to strip out or convert other invalid characters/symbols in the heading string.  

Note if this editing is done in /includes/Skin.php (where the data is constructed), it will result in the modified text being displayed on the wiki page.  Modifying it in the /skins/skinname.php file(s) preserves the display and only prevents the invalid HTML from being generated.
Comment 1 Rob Church 2007-06-20 07:08:30 UTC

*** This bug has been marked as a duplicate of bug 9338 ***

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


Navigation
Links