Page MenuHomePhabricator

SelectCategoryTagCloud is not properly escaping tags
Closed, DeclinedPublic

Description

Author: fhidalgo

Description:
When we have one category with the char: ", extension broken html because, we print in function createTagCloud, in SelectCategoryTagCloud.body.php:

$currentRow = "<span title='" .wfMsg( 'selectcategory-tooltip' ). "' onclick='checkCategory(this)' class='" . $existingClass . $link_class . "' style='{$style}'>" . $title->getText() . "</span>&nbsp; ";

I have solved it, changed the line by:
$currentRow = "<span title='" .wfMsg( 'selectcategory-tooltip' ). "' onclick='checkCategory(this)' class='" . $existingClass . $link_class . "' style='{$style}'>" . str_replace('"','&quot;',$title->getText()) . "</span>&nbsp; ";

Regards!


Version: unspecified
Severity: major
URL: http://www.blobject.es

Details

Reference
bz20999

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:48 PM
bzimport set Reference to bz20999.

This is not a proper fix, you should use htmlspecialchars($title->getText()) instead.

I'm removing the "need-review" keyword. Roan reviewed the "patch" in comment 1. (I think the "patch" keyword is a bit silly here as well, but I'll leave it for now.)

(In reply to comment #1)

This is not a proper fix, you should use htmlspecialchars($title->getText())
instead.

I thought there was a MediaWiki-specific escape function that people used instead of htmlspecialchars. Maybe I'm thinking of something else?

sumanah wrote:

Adding "reviewed" keyword for clarity.

Hidabe, if you have time to revisit this issue, please stop into our chat channel, MediaWiki-General https://www.mediawiki.org/wiki/MediaWiki_on_IRC to discuss approach. Thanks!

[Fixing the "Component" field - SelectCategoryTagCloud != SelectCategory]

Download link seems down, so it's fairly hard to debug that extension, archive it?