The wbsetsitelink api module return the link to the page a site-link was set to. Right now the UI is generating the links in JavaScript but this can be erroneous (if the foreign wiki/site has different settings we don't know about and don't consider when constructing the link).
Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=40073