It doesn't. The fix I posted was not the limit fix. It was the Allpages fix because Allpages sends bad form data.
I think I found the culprit for why this is only happening for you and not on this site. It can only happen if the namespace the Special page searches has whitespace in the title. I believe there is a mismatch occurring when it passes the namespace through the URL because the + character is changed by the server when it reads the URL.
In your case, it works correctly when the namespace is missing from the URL, but when the namespace "Vault Wiki" is searched (note the + was removed internally by the server), it can't find the namespace because it expects "Vault+Wiki". However, because the namespace was entered, it attempts to make do with the NULL it resolves to. Passing a NULL value to the special permissions tells the Special page to search
all forums for results pages. We get a lot of results and the limits are generated likewise, resulting in navigation to a high page.
Because the namespace resolved to NULL, the URL used for navigation doesn't include a namespace entry. On the next page, the namespace will resolve to the default space "Vault+Wiki" (the next page would circle around again). We now get the appropriate limits and the appropriate number of results. However, the previous page had high limits, and the results page we're requesting may already be too high and trigger the database error.
I've done some more work with the "+" encoding format in multiple locations throughout VaultWiki, and I believe it should work now.
In
vault/special_plugins.php, find:
Code:
if (
in_array($space, $vault->namespaces_lower) AND
$space != $titlecache
)
Add before:
Code:
$space = $titlebits[0];
In
vault/special_class_wiki.php, find:
Code:
$this->namespaces_lower["$id"] = strtolower($this->urlencode($text, $id));
Replace with:
Code:
$temp = strtolower($this->urlencode($text, $id));
if ($vbulletin->options['vault_spaces'] == 0)
{
$temp = str_replace('+', ' ', $temp);
}
$this->namespaces_lower["$id"] = $temp;
In
vault/special_class_redirect.php, find:
Code:
$titlebits[0] = $vault->urlencode($titlebits[0]);
$vault->fetch_namespace_array(true);
if (in_array(strtolower($titlebits[0]), $vault->namespaces_lower) AND $titlebits[0] != $text)
{
$title = $titlebits[1];
$hook_namespace = array_search(strtolower($titlebits[0]), $vault->namespaces_lower);
}
Replace with:
Code:
$space = $vault->urlencode($titlebits[0]);
$vault->fetch_namespace_array(true);
if ($this->parser->registry->options['vault_spaces'] == 0)
{
$space = str_replace('+', ' ', $space);
}
if (in_array(strtolower($space), $vault->namespaces_lower) AND $titlebits[0] != $text)
{
$title = $titlebits[1];
$hook_namespace = array_search(strtolower($space), $vault->namespaces_lower);
}