Anchors Don't Follow Encode Rules
When using the H tag to create sections, the anchors created by them and pointed to by the article's table of contents don't follow the same URL rules as article titles. This is inconsistent and can lead to ugly URLs (with anchors).
Additionally, when using additional parameters in wiki link BB-Codes to create query strings and add anchors, the query string is encoded using the wiki's URL rules, which can corrupt non-article-title strings.
Fixed for the next build. In
vault/special_plugins_bbcode.php, find:
Code:
if ($first['char'] == '#')
{
$anchor = '#' . $vault->anchorify(strip_tags($first['bit']));
}
else
{
$urlpieces[0] = $vault->urlencode($urlpieces[0]);
$entry = $vault->urlencode($entry);
$requests .= "&" . $urlpieces[0] . (!empty($entry) ? "=$entry" : '');
}
Replace with:
Code:
if ($first['char'] == '#')
{
$anchor = '#' . $vault->urlencode(strip_tags($first['bit']));
}
else
{
$urlpieces[0] = urlencode($urlpieces[0]);
$entry = urlencode($entry);
$requests .= "&" . $urlpieces[0] . (!empty($entry) ? "=$entry" : '');
}
Find:
Code:
$anchor_name = $vault->anchorify($header_title);
Replace with:
Code:
$anchor_name = $vault->urlencode($header_title);