It turns out that the PHP urlencode encodes more characters than
the ruby URI.encode does by default, so specify our own characters
to encode based on http://php.net/manual/en/function.urlencode.php
with the extra exclusion of colon, which the mediawiki code reverses
after the encoding is done.
Fixes#967
This replaces OpenID authentication, which is going away soon, but
provides an upgrade path where we can migrate users that already have
a Google OpenID setup to the new system transparently.
Browsers's are inconsistent in how they interpret the encoding
of a response header in an XHR request, so URI encode it so that
it simple ASCII we can then decode it again in the browser.
Analogous to wikipedia tags this links any wikidata tag with its item
page on wikidata.
For now it's restricted to the plain wikidata=* tag (namespaces like
operator:wikidata=* and similar are not yet supported) and only accepts
the values with the format Q<number>.
International phone numbers become links using the official URI scheme
as per http://tools.ietf.org/html/rfc3966.
It is not limited to key=phone, so it can be used in other keys as well.
When creating a wikipedia link from a tag, the function
is (correctly) appending "?userlang=#{I18N.lang}" to the URL,
but doing this breaks the reference to a specific section
of a wikipedia article (if there is any).
For example, if the tag is "wikipedia=Article#Section", the function
would create a link to "../Article#Section?uselang=xx", and then the
browser wouldn't be able to correctly find the section. The correct
link result should be "../Article?uselang=xx#Section".
This commit fixes this by verifying if there is a reference to a
specific section of the article, and then putting "?uselang=#{I18N.lang}"
between the article's name and the section name.