I got a weird problem with CodeIgniter's URI segment system.
When I have this URL:
http://www.mywebsite.com/forums/category_name/forum_name/topic_name.. (yes, the name has two dots)
Now I do this in PHP:
$topic = $this->uri->segment(4);
>>> echo $topic: 'topic_name..'
This works perfectly. But here comes the weirdness.. When I append a reply to the URL like this:
http://www.mywebsite.com/forums/category_name/forum_name/topic_name../reply
Now I do the PHP code again:
$topic = $this->uri->segment(4);
>>> echo $topic: 'topic_name '
As you can see it suddenly replaces my ".." with " " (one space, why not even two?).
Does anyone have any idea if the URI segment method might maybe sanitize something when I add a segment after one with dots ("."). The odd thing is when I manually fix the URL with a space behind it, it works again because after the trim() it still has the ".."'s left, where CodeIgniter didn't seem to touch them this time:
http://www.mywebsite.com/forums/category_name/forum_name/topic_name..%20/reply
$topic = $this->uri->segment(4);
> echo $topic: 'topic_name.. '
>>> echo trim($topic): 'topic_name..'