Last modified: 2014-02-12 23:38:04 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 T30790, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28790 - Filter using combo box input type fails when property values contain ampersand '&' characters
Filter using combo box input type fails when property values contain ampersan...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SemanticDrilldown (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-03 11:09 UTC by Matt Voysey
Modified: 2014-02-12 23:38 UTC (History)
0 users

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


Attachments

Description Matt Voysey 2011-05-03 11:09:46 UTC
Using combo box input type for a drilldown filter, covering a semantic property of type String. On the Browse Data page, the list of property values available for this filter displayed in the combo box includes some strings containing ampersand characters (for example "Electronics & Computer Science"). If one of these values is selected as the filter then no results are returned. 

If the standard "list of values" input type is used then the filter works properly when values with ampersands are selected.

Maybe this could be a htmlencode/htmldecode problem reading the selected string from the combo box?
Comment 1 Yaron Koren 2011-08-14 14:52:43 UTC
I just tried this out (after a long delay), and it seems like it works for me - are you still seeing this problem?
Comment 2 Matt Voysey 2011-09-05 11:11:48 UTC
Hi Yaron, I tried this on a clean install of MediaWiki 1.17.0 with SemanticBundle 2011-08-24.20110824 (SemanticDrilldown 0.8.3) and the problem still occurred. So I decided to investigate further...

After some debugging I traced the problem to a difference in the SDAppliedFilter instance that gets created when using a combo box to enter filter values versus the standard list of values input type - I was seeing, for example, "Singer & Songwriter" in the first case, and "Singer & Songwriter" in the second.

Traced the cause of this to SD_AppliedFilter.php line 21, where the value of the _search_ parameter gets htmlspecialchars run on it. Removing this call fixed the problem with ampersands.

In SD_AppliedFilter.php line 21 - change:

$af->search_term = htmlspecialchars( str_replace( '_', ' ', $search_term ) );

to:

$af->search_term = str_replace( '_', ' ', $search_term );

I tested for possible side-effects of the above by creating some other values for property values with nasty <, >, " characters - it seems they already don't work very well with the combo box input (particularly for a value like "Artist" or <Artist> - just don't appear at all), but other values such as Builder's Merchant (containing apostrophe) work fine with or without the fix above.

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


Navigation
Links