Skip to content

Commit

Permalink
Fix issue bcit-ci#2061
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Dec 7, 2012
1 parent b2280ce commit 9515dd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions system/core/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,21 @@ public function _set_routing()
// since URI segments are more search-engine friendly, but they can optionally be used.
// If this feature is enabled, we will gather the directory/class/method a little differently
$segments = array();
if ($this->config->item('enable_query_strings') === TRUE && isset($_GET[$this->config->item('controller_trigger')]))
if ($this->config->item('enable_query_strings') === TRUE
&& ! empty($_GET[$this->config->item('controller_trigger')])
&& is_string($_GET[$this->config->item('controller_trigger')])
)
{
if (isset($_GET[$this->config->item('directory_trigger')]))
if (isset($_GET[$this->config->item('directory_trigger')]) && is_string($_GET[$this->config->item('directory_trigger')]))
{
$this->set_directory(trim($this->uri->_filter_uri($_GET[$this->config->item('directory_trigger')])));
$segments[] = $this->fetch_directory();
}

if (isset($_GET[$this->config->item('controller_trigger')]))
{
$this->set_class(trim($this->uri->_filter_uri($_GET[$this->config->item('controller_trigger')])));
$segments[] = $this->fetch_class();
}
$this->set_class(trim($this->uri->_filter_uri($_GET[$this->config->item('controller_trigger')])));
$segments[] = $this->fetch_class();

if (isset($_GET[$this->config->item('function_trigger')]))
if ( ! empty($_GET[$this->config->item('function_trigger')]) && is_string($_GET[$this->config->item('function_trigger')]))
{
$this->set_method(trim($this->uri->_filter_uri($_GET[$this->config->item('function_trigger')])));
$segments[] = $this->fetch_method();
Expand All @@ -142,7 +142,7 @@ public function _set_routing()
include(APPPATH.'config/routes.php');
}

$this->routes = (isset($route) && is_array($route)) ? $route : array();
$this->routes = (empty($route) OR ! is_array($route)) ? array() : $route;
unset($route);

// Set the default controller so we can display it in the event
Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ Bug fixes for 3.0
- Fixed a bug (#18) - :doc:`APC Cache <libraries/caching>` driver didn't (un)serialize data, resulting in failure to store objects.
- Fixed a bug (#188) - :doc:`Unit Testing Library <libraries/unit_testing>` filled up logs with error messages for non-existing language keys.
- Fixed a bug (#113) - :doc:`Form Validation Library <libraries/form_validation>` didn't properly handle empty fields that were specified as an array.
- Fixed a bug (#2061) - :doc:`Routing Class <general/routing>` didn't properly sanitize directory, controller and function triggers with **query_strings** set to TRUE.

Version 2.1.3
=============
Expand Down

0 comments on commit 9515dd3

Please sign in to comment.