function _fetch_uri_string() { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { // Let's try ORIG_PATH_INFO! This is an edge case, and in most cases won't be necessary, // but we need to try it first, because on servers where REQUEST_URI does not work, // CI still thinks it worked, and doesn't check the alternatives. $path = isset($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); $path = substr($path, 0, 10) == '/index.php' ? substr($path, 10) : $path; $path = substr($path, 0, 1) == '/' ? substr($path, 1) : $path; # To fix another bug, we have to remove index.php from the thing completely. First, let's add a slash to the end if it needs one. $path = substr($path, -1) == '/' ? $path : $path . '/'; $path = str_ireplace('/index.php/', '/', $path); # Now, let's see if the start of $path is in the end of $url. $strlen = strlen($path); while ($strlen > 0) { if (substr(BASE_URL, -$strlen) == substr($path, 0, $strlen)) { $path = str_ireplace(substr($path, 0, $strlen), '', substr($path, 0, $strlen)); break; } $strlen--; } if (trim($path, '/') != '') { $this->uri_string = $path; return; } } parent::_fetch_uri_string(); if (substr($this->uri_string, 0, 10) == 'index.php/') { $this->uri_string = substr($this->uri_string, 10); } }
function _fetch_uri_string() { $base_url = $this->protocol() . '://'; $base_url .= $this->host(); $base_url .= parse_url($this->config->item('base_url'), PHP_URL_PATH); $this->config->set_item('base_url', $base_url); parent::_fetch_uri_string(); }
/** * Get the URI String * * @access private * @return string */ function _fetch_uri_string() { log_message('debug', "MY URI - Hack for PHPUnit to run"); if (ENVIRONMENT == 'testing') { $this->uri_string = ''; return; } parent::_fetch_uri_string(); }
/** * Fetch uri string extension * * We hook into fetch_uri_string to look for a session id in the $_GET * array, before passing it on to CI to figure out a url. Doing it after * CI did not work with query strings and auto since key($_GET) comes out * as /S, which is not a good path * * @access private * @return void */ function _fetch_uri_string() { $key = FALSE; if (is_array($_GET)) { if (isset($_GET['S'])) { $key = 'S'; } elseif (trim(key($_GET), '/') == 'S') { $key = key($_GET); } } if ($key) { $val = $_GET[$key]; unset($_GET[$key]); $x = explode('/', $val); // Set the session ID $this->session_id = array_shift($x); $leftovers = implode('/', $x); if ($leftovers) { $_GET = array($leftovers => '1') + $_GET; } } return parent::_fetch_uri_string(); }