[eluser]coolfactor[/eluser]
The URI class doesn't properly recognize/handle anchors in URIs in certain situations.
Here's an illustration using a custom route from an old address, mission.html, to an anchor in CI-powered page, /page/info#mission.
Code:
$route['mission.html'] = 'page/info#mission';
Here's the
URI::ruri_string() function:
Code:
function ruri_string()
{
return '/'.implode('/', $this->rsegment_array()).'/';
}
The
ruri_string() function will return "/page/info#mission/", corrupting the anchor reference. Looking at the internal URI::$rsegments array, shows segment 2 being "info#mission".
(One workaround is to precede the hash by a slash,
page/info/#mission, but then segment 3 would become "#mission", which is technically incorrect.)
I propose that the URI class parse out the anchor reference to a separate variable, and reapply it as needed. Discussion?