Page MenuHomePhabricator

slashes in identifiers get rendered incorrectly
Closed, ResolvedPublic

Description

First reported at the Wikidata village pump (https://www.wikidata.org/w/index.php?title=Wikidata:Project_chat&oldid=307147924#Freebase_links_are_broken) "It seems that the urlencoder for Freebase identifier (P646) is broken, it produces %2f instead of /. See for example Anderswo (Q20992288)"

Freebase identifier (https://www.wikidata.org/wiki/Property:P646) recently got converted from string to identifier. If you look at https://www.wikidata.org/wiki/Q20992288 you'll see the problem in action. %2f is the urlencoded version of '/' so my assumption is that the new identifier code urlencodes the string to prevent html code from being injected?

Event Timeline

Note this may be just a problem for the Freebase Identifier; if you replace just the leading '%2f' with '/' the remaining '%2f' characters are correctly interpreted by the server (as they should be) - the problem is the formatter URL ends with the server name which is probably a bad idea (but may be how freebase needs to work?)

Change 273309 had a related patch set uploaded (by JanZerebecki):
Fix over-encoding of expanded URLs

https://gerrit.wikimedia.org/r/273309

Change 273309 merged by jenkins-bot:
Fix over-encoding of expanded URLs

https://gerrit.wikimedia.org/r/273309

Change 273467 had a related patch set uploaded (by JanZerebecki):
Fix over-encoding of expanded URLs

https://gerrit.wikimedia.org/r/273467

Change 273914 had a related patch set uploaded (by JanZerebecki):
Update Wikibase: Fix over-encoding of expanded URLs

https://gerrit.wikimedia.org/r/273914

Change 273914 abandoned by JanZerebecki:
Update Wikibase: Fix over-encoding of expanded URLs

Reason:
wrong branch

https://gerrit.wikimedia.org/r/273914

Change 273917 had a related patch set uploaded (by JanZerebecki):
Update Wikibase: Fix over-encoding of expanded URLs

https://gerrit.wikimedia.org/r/273917

Change 273917 merged by jenkins-bot:
Update Wikibase: Fix over-encoding of expanded URLs

https://gerrit.wikimedia.org/r/273917

Peter_James added a subscriber: Peter_James.

Slashes are still converted to %2F in UK Parliament thesaurus ID (https://www.wikidata.org/wiki/Property:P4527). The formatter is http://explore.data.parliament.uk/?endpoint=terms/$1

Mbch331 assigned this task to JanZerebecki.
Mbch331 added a subscriber: Mbch331.

Slashes are still converted to %2F in UK Parliament thesaurus ID (https://www.wikidata.org/wiki/Property:P4527). The formatter is http://explore.data.parliament.uk/?endpoint=terms/$1

The url generated by Wikidata is: http://explore.data.parliament.uk/?endpoint=terms/8193 this gets redirected to https and then it's changed to %2F.
Solution is to prevent the redirect by changing the formatter url