Someone else had this problem and I was able to come up with what seems to be a working fix for the "+" namespaces:
Code:
function fetch_namespace_array($lower = false)
{
if ($lower)
{
if (!empty($this->namespaces_lower))
{
return;
}
global $vbulletin;
if (empty($this->namespaces))
{
$this->fetch_namespace_array();
}
foreach ($this->namespaces AS $id => $text)
{
$temp = strtolower($this->urlencode($text, $id));
if ($vbulletin->options['vault_spaces'] == 0)
{
$temp = str_replace('+', ' ', $temp);
}
$this->namespaces_lower["$id"] = $temp;
}
return;
}
global $vbulletin;
if (!empty($this->namespaces))
{
return;
}
$this->namespaces = array();
if (!empty($vbulletin->options['vault_namespaces']))
{
$this->namespacecache = unserialize($vbulletin->options['vault_namespaces']);
}
if (!is_array($this->namespacecache))
{
$this->namespacecache = array();
return;
}
foreach ($this->namespacecache AS $namespaceid => $namespace_info)
{
if (
empty($namespace_info['forumid']) AND
$namespaceid != ISLAND_SPACE AND
$namespaceid != SPECIAL_SPACE
)
{
continue;
}
/*
* 0 => island,
* 1 => special,
* 2 => template,
* 3 => help,
* 4 => header,
* 5 => book,
* 6 => default
*/
// tags are for markup and should be ignored
$this->namespaces["$namespaceid"] = strip_tags($namespace_info['title']);
}
}
Code:
function special_verify_id($idname, &$fallbackid, $alert = true, $selall = false, $options = 0)
{
global $vbulletin, $vault;
$type = 'wiki';
// $_REQUEST vars are already decoded!!!
$id = $vbulletin->GPC[$vbulletin->options['ces_titlevar']];
if (stripos($id, 'island:') === 0)
{
$fallbackid = substr($id, 7);
$id = '';
}
if (empty($id) AND intval($fallbackid))
{
$type = 'island';
$id = $fallbackid;
}
if (empty($id))
{
if ($alert)
{
global $globaltemplates, $show;
$vault->error += VAULT_NOID;
$id = $vault->namespacecache[SPECIAL_SPACE]['title'] . ':' . $GLOBALS['vbphrase']['search_title'];
$vault->misc['special'] = 'search';
$type = 'wiki';
$globaltemplates[] = 'vault_search_noid';
}
else
{
return array($idname . 'id' => 0);
}
}
if ($type == 'island')
{
$fetchid = $id;
$titlecache = '';
}
$selid = ($selall ? '*' : $idname . 'id');
if ($type != 'island')
{
if (
$_SERVER['REQUEST_METHOD'] == 'POST' AND
(
$_POST['do'] == 'create' OR
$_POST['do'] == 'edit'
) AND
empty($_POST['edittitle']) AND
!$vbulletin->GPC['ajax']
)
{
$test = array(
'title' => $id,
'forumid' => $vbulletin->GPC['forumid'],
'prefixid' => $_POST['prefixid']
);
$vault->affix_prefix($test);
$id = $test['title'];
}
$titlecache = strtolower($id);
$titlebits = explode(':', $titlecache, 2);
if ($vbulletin->GPC['forumid'] > 0)
{
$islandforum = fetch_foruminfo($vbulletin->GPC['forumid']);
if ($islandforum['vault_type'] == 2)
{
$hook_namespace = 0;
}
else
{
$hook_namespace = $vault->fetch_namespaceid($vbulletin->GPC['forumid']);
}
}
$vault->fetch_namespace_array(true);
if (
in_array($titlebits[0], $vault->namespaces_lower) AND
$titlebits[0] != $titlecache
)
{
$titlecache = $titlebits[1];
$new_hook_namespace = array_search($titlebits[0], $vault->namespaces_lower);
$forumcache = $titlebits[0];
if (isset($hook_namespace) AND $new_hook_namespace != $hook_namespace)
{
// we actually want the namespace in the title in another namespace
$there_was_no_namespace = true;
$forumcache = $vault->namespaces["$new_hook_namespace"];
$titlecache = implode(':', $titlebits);
}
else
{
$there_was_no_namespace = false;
}
$hook_namespace = $new_hook_namespace;
}
else
{
if ($islandforum['vault_type'] != 2)
{
if (!$hook_namespace OR empty($vault->namespaces["$hook_namespace"]))
{
$hook_namespace = intval($vbulletin->options['ces_default_forumid']);
}
$forumcache = $vault->namespaces["$hook_namespace"];
}
$titlecache = implode(':', $titlebits);
$there_was_no_namespace = true;
}
if ($hook_namespace)
{
$fetchid = $vault->fetch_article($titlecache, $hook_namespace, VAULT_LANGUAGEID, 'threadid');
}
else
{
$fetchid = false;
}
}
($hook = vBulletinHook::fetch_hook('vault_verify_id')) ? eval($hook) : false;
if (($islandforum['vault_type'] == 2 OR $fetchid) AND empty($check))
{
if ($selid == '*')
{
$vault->misc['fetchid'] = $fetchid ? $fetchid : $titlecache;
$vault->misc['hook_namespace'] = intval($hook_namespace);
$vault->misc['fetch_lastpostinfo'] = true;
if ($idname == 'post')
{
global $threadinfo, $postcache;
$threadinfo = fetch_threadinfo($fetchid, false);
$postcache[$threadinfo['firstpostid']] = NULL;
$check = fetch_postinfo($threadinfo['firstpostid']);
}
else if ($idname == 'thread')
{
$check = fetch_threadinfo($fetchid, false);
}
}
else
{
$check = $vbulletin->db->query_first("
SELECT $idname.$selid, IF(forum.vault_type = 2, 1, 0) AS island
FROM " . TABLE_PREFIX . "$idname AS $idname" . ($idname == 'post' ? "
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)" : "") . "
LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (thread.forumid = forum.forumid)
WHERE $idname.threadid = " . intval($fetchid) . "
ORDER BY $idname.dateline ASC
");
}
}
if (empty($check) AND $alert)
{
if ($type == 'island')
{
global $vbphrase;
$vault->error += VAULT_ISLAND_ERROR;
$vault->errno = $idname;
}
if (!$fetchid AND $idname == 'post')
{
global $threadinfo;
}
if ($idname == 'post')
{
$threadinfo['threadid'] = 'error';
}
else
{
$check['threadid'] = 'error';
}
if (
// this was direct request
$_SERVER['REQUEST_METHOD'] == 'GET' OR
(
// all we did was switch tabs
$_REQUEST['do'] == 'edit' AND
empty($_POST['forumid'])
)
)
{
// make best guess at intended title
$id = $vault->urldecode($id);
}
if ($there_was_no_namespace)
{
if ($idname == 'post')
{
$threadinfo['title'] = $id;
}
else
{
$check['title'] = $id;
}
}
else
{
if ($idname == 'post')
{
$threadinfo['title'] = substr($id, strpos($id, ':') + 1);
}
else
{
$check['title'] = substr($id, strpos($id, ':') + 1);
}
}
if ($idname == 'post')
{
// the db title would have been html encoded
$threadinfo['title'] = htmlspecialchars_uni($threadinfo['title']);
$threadinfo['namespaceid'] = $hook_namespace;
$threadinfo['firstpostid'] = -1;
if ($islandforum['vault_type'] == 2)
{
$threadinfo['forumid'] = $vbulletin->GPC['forumid'];
}
else if ($hook_namespace != SPECIAL_SPACE)
{
$threadinfo['forumid'] = $vault->namespacecache["$hook_namespace"]['forumid'];
}
}
else
{
// the db title would have been html encoded
$check['title'] = htmlspecialchars_uni($check['title']);
$check['namespaceid'] = $hook_namespace;
$check['firstpostid'] = -1;
if ($islandforum['vault_type'] == 2)
{
$check['forumid'] = $vbulletin->GPC['forumid'];
}
else if ($hook_namespace != SPECIAL_SPACE)
{
$check['forumid'] = $vault->namespacecache["$hook_namespace"]['forumid'];
}
}
if ($hook_namespace > SPECIAL_SPACE AND $vbulletin->forumcache[($idname == 'post' ? $threadinfo['forumid'] : $check['forumid'])]['vault_type'] != 1)
{
$vault->error += VAULT_TOP_LEVEL;
}
}
unset($there_was_no_namespace, $hook_namespace, $fetchid, $type);
return ($selall ? $check : $check["$selid"]);
}