*  @param ns a list of namespaces to filter by, empty = all namespaces.
     *  @param redirects whether we should limit to redirects only
     *  @return the list of pages linking to the specified page
     *  @throws IOException if a network error occurs
     *  @since 0.10
     */
    public String[] whatLinksHere(String title, boolean redirects, int... ns) throws IOException
    {
        StringBuilder url = new StringBuilder(query);
        url.append("list=backlinks&bllimit=max&bltitle=");
        url.append(URLEncoder.encode(normalize(title), "UTF-8"));
        constructNamespaceString(url, "bl", ns);
        if (redirects)
            url.append("&blfilterredir=redirects");

        // main loop
        ArrayList<String> pages = new ArrayList<String>(6667); // generally enough
        String temp = url.toString();
        String next = "";
        do
        {
            // fetch data
            String line = fetch(temp + next, "whatLinksHere");

            // set next starting point
            if (line.contains("blcontinue"))
                next = "&blcontinue=" + parseAttribute(line, "blcontinue", 0);
            else
                next = null;

            // xml form: <bl pageid="217224" ns="0" title="Mainpage" redirect="" />
            for (int x = line.indexOf("<bl "); x > 0; x = line.indexOf("<bl ", ++x))
                pages.add(decode(parseAttribute(line, "title", x)));
        }
        while (next != null);

        int size = pages.size();
        log(Level.INFO, "Successfully retrieved " + (redirects ? "redirects to " : "links to ") + title + " (" + size + " items)", "whatLinksHere");
        return pages.toArray(new String[size]);
    }