Page MenuHomePhabricator

Does not like reading URLs with apostrophes
Closed, InvalidPublic

Description

I am getting errors from {{#get_web_data: url=https://files.johnbray.org.uk/Documents/Fandom/wiki/pages/BECCON%20'81/overview ...

Error while fetching data from URL https://files.johnbray.org.uk/Documents/Fandom/wiki/pages/BECCON%20'81/overview: $2.
There was a problem during the HTTP request: 404 Not Found

I'm using mediawiki-extensions-ExternalData-master cloned Feb 3 2021 in mediawiki 1.35

for a range of URLs with apostrophes. Web browsers, curl and wget all accept the URL https://files.johnbray.org.uk/Documents/Fandom/wiki/pages/BECCON%20'81/overview

Changing the apostrophe to a %27 with a {{#rreplace did not help

Event Timeline

Tried mediawiki-extensions-ExternalData-3.0, same problem

On further investigation, it turned out to be a problem with FULLPATH. As https://www.mediawiki.org/wiki/Help:Magic_words says

Page titles containing certain characters, such as apostrophes ' or asterisks *, may produce unexpected results when handled with these magic words,

e.g. {{PAGESINCATEGORY:{{PAGENAME}}}}. See bugs T16779, T18474, T37628, T37746. One simple way to fix this is wrapping the pagename in {{#titleparts:}} from the ParserFunctions extension.

setting url={{#titleparts|{{FULLPATHNAME}}}} fixed the problem.

Sorry to bother you