Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

URI string format inconsistency #779

Closed
janogarcia opened this Issue Dec 13, 2011 · 0 comments

Comments

Projects
None yet
2 participants

Tested in CodeIgniter 2.1.0.

According to the issue #9 the $uri_string property of the URI class should never contain a leading forward slash:
EllisLab#9 (comment)

However this does depend on the detection method used by $this->uri->_fetch_uri_string()

For example: _detect_uri() trims the leading slash, while the $_SERVER['PATH_INFO'] based method preserves it.

The temporary fix I made removes always any leading or trailing forward slash from $this->uri->uri_string, as that is the intended behavior since the CodeIgniter Reactor era.

$path should be always trimmed trim($path, '/') before calling $this->_set_uri_string($path), as $this->_detect_uri() does.

@narfbg narfbg added a commit that referenced this issue Oct 22, 2012

@narfbg narfbg Fix issue #779 f5f898f

@narfbg narfbg closed this Oct 22, 2012

@nonchip nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013

@narfbg narfbg Fix issue #779 1e0163d

@baypup baypup pushed a commit to baypup/CodeIgniter that referenced this issue Aug 20, 2015

@benedmunds benedmunds Merge pull request #779 from marcopineschi/patch-1
Corrected for compatibility with CI v3
444ccb4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment