Page MenuHomePhabricator

SRF Exhibit: URLs need to be encoded in facets
Closed, ResolvedPublic

Description

Author: laurent

Description:
I recently updated my version of Semantic Result Formats and I noticed links from facets appear to be broken. I could swear it used to work before but I can't tell which version was working.

Basically - links used for the title of facets and links used values of properties are not escaped properly and appear as 'broken' as soon as special characters are used. This is visible from the Map, Timeline and Tile views (since the Table view removes all hyperlinks for some odd reason).

I tracked the issue down to the use of the same string both for display and URL of a '_wpg' type.

I tried messing with URL encoding of the property values at line 296 :

switch($object->getTypeID()){

case '_wpg':
---> $textstack[] = $object->getLongText($outputmode,$this->getLinker(0));

Replacing spaces by '_' on that line seems to be working, however, using URL encoding functions creates other issues (such as encoded characters become visible in the table view).

I ended up fixing the issue by replacing full URLs in lines 247 ($lensstack[]) and 254 ($lenssrc = ) (using scriptPath and 'index.php?title=') by short URLs as defined on my wiki. Going from short URL mapping to full URL takes care of proper encoding of spaces and other special characters.

This solution is a hack though. There must be a clean way to do this instead of expecting the existence of short URLs mappings :)


Version: unspecified
Severity: enhancement

Details

Reference
bz18931

Event Timeline

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