[Mediawiki-api] Mediawiki Wikipedia API bug

Roan Kattouw roan.kattouw at gmail.com
Wed Sep 28 13:58:52 UTC 2011

On Wed, Sep 28, 2011 at 1:54 AM, Roan Kattouw <roan.kattouw at gmail.com> wrote:
>> It would be really great if you
>> could allow us some flexibility in this area though -- could you maybe
>> put in a temporary workaround in action=parse to resolve the protocol
>> relative links?
> That might work. I'll look into that but it'll have to wait tomorrow,
> because it's almost 2am and I need sleep.
I have now deployed a temporary hack that does a few things
differently in action=parse:

1) Links that would normally be internal links (/wiki/Main_Page) are
now fully-qualified URLs (http://en.wikipedia.org/wiki/Main_Page).
This is similar to action=render's behavior, except that that
generates protocol-relative URLs (//en.wikipedia.org). This sounds
weird and unnecessary, and at first I thought it was, but if I don't
do this, some URLs like
//en.wikipedia.org/w/index.php?title=Talk:Foo&action=edit are
2) Paths to images, resources, etc etc are all fully-qualified

On http://en.wikipedia.org/w/api.php?action=parse&page=Cereal , this
made searching for '"//' (double quote slash slash) turn up nothing,
which satisfied me. So your clients should all be "fixed" now, in that
we should be working around their bugs completely.

Because of the cache splitting involved, this is causing a load
increase on our API cluster. So please let me know when the iOS
clients are fixed and I can turn this hack back off. I am not leaving
this up for more than two weeks, though, so I will turn it off on
October 12th if I don't hear from you before then.


More information about the Mediawiki-api mailing list