Welcome Guest, Not a member yet? Register   Sign In
Please consider querystring support in 2.x
#58

[eluser]DJMOHNL[/eluser]
[quote author="skunkbad" date="1280529093"]This is working, and probably the kosher way:

MY_Input.php (as suggested a few posts back)
Code:
<?php
// this allows for $_GET access
class MY_Input extends CI_input {
    function _sanitize_globals() {
        $this->allow_get_array = TRUE;
        parent::_sanitize_globals();
    }
}

MY_URI.php
Code:
<?php
// this allows for $_GET access and uri segments to work together
class MY_URI extends CI_URI{
    function _fetch_uri_string()
    {
        if (strtoupper($this->config->item('uri_protocol')) == 'AUTO')
        {
            // If the URL has a question mark then it's simplest to just
            // build the URI string from the zero index of the $_GET array.
            // This avoids having to deal with $_SERVER variables, which
            // can be unreliable in some environments
            if ($this->config->item('enable_query_strings') === TRUE && is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '')
            {
                $this->uri_string = key($_GET);
                return;
            }

            // Is there a PATH_INFO variable?
            // Note: some servers seem to have trouble with getenv() so we'll test it two ways
            $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
            if (trim($path, '/') != '' && $path != "/".SELF)
            {
                $this->uri_string = $path;
                return;
            }

            // No PATH_INFO?... What about QUERY_STRING?
            $path =  (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');
            if (trim($path, '/') != '')
            {
                $this->uri_string = $path;
                return;
            }

            // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists?
            $path = str_replace($_SERVER['SCRIPT_NAME'], '', (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'));
            if (trim($path, '/') != '' && $path != "/".SELF)
            {
                // remove path and script information so we have good URI data
                $this->uri_string = $path;
                return;
            }

            // We've exhausted all our options...
            $this->uri_string = '';
        }
        else
        {
            $uri = strtoupper($this->config->item('uri_protocol'));

            if ($uri == 'REQUEST_URI')
            {
                $this->uri_string = $this->_parse_request_uri();
                return;
            }

            $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri);
        }

        // If the URI contains only a slash we'll kill it
        if ($this->uri_string == '/')
        {
            $this->uri_string = '';
        }
    }
}
[/quote]

next time you try create an MY_Input.php youll see that you need to add all the functions inside this one, wich isnt very smart to do.. Yust add the system "get patch" and it gives you a far better patch (nothing gets broken, its tested by more than a dosen people here)


Messages In This Thread
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 12:52 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 01:55 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 02:45 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 02:48 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 02:57 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 03:23 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 03:47 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 03:59 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 04:07 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 07:46 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 08:09 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 08:41 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 09:26 AM
Please consider querystring support in 2.x - by El Forum - 06-29-2010, 11:45 AM
Please consider querystring support in 2.x - by El Forum - 06-30-2010, 03:36 AM
Please consider querystring support in 2.x - by El Forum - 06-30-2010, 04:57 AM
Please consider querystring support in 2.x - by El Forum - 06-30-2010, 05:00 AM
Please consider querystring support in 2.x - by El Forum - 06-30-2010, 08:58 AM
Please consider querystring support in 2.x - by El Forum - 06-30-2010, 09:39 AM
Please consider querystring support in 2.x - by El Forum - 06-30-2010, 09:49 AM
Please consider querystring support in 2.x - by El Forum - 07-01-2010, 03:32 AM
Please consider querystring support in 2.x - by El Forum - 07-01-2010, 11:50 AM
Please consider querystring support in 2.x - by El Forum - 07-01-2010, 12:11 PM
Please consider querystring support in 2.x - by El Forum - 07-01-2010, 09:14 PM
Please consider querystring support in 2.x - by El Forum - 07-02-2010, 02:13 AM
Please consider querystring support in 2.x - by El Forum - 07-13-2010, 03:49 AM
Please consider querystring support in 2.x - by El Forum - 07-13-2010, 09:11 AM
Please consider querystring support in 2.x - by El Forum - 07-13-2010, 10:28 AM
Please consider querystring support in 2.x - by El Forum - 07-13-2010, 11:29 AM
Please consider querystring support in 2.x - by El Forum - 07-13-2010, 01:16 PM
Please consider querystring support in 2.x - by El Forum - 07-24-2010, 02:14 AM
Please consider querystring support in 2.x - by El Forum - 07-24-2010, 02:24 AM
Please consider querystring support in 2.x - by El Forum - 07-26-2010, 02:47 AM
Please consider querystring support in 2.x - by El Forum - 07-26-2010, 03:33 AM
Please consider querystring support in 2.x - by El Forum - 07-26-2010, 03:41 AM
Please consider querystring support in 2.x - by El Forum - 07-28-2010, 11:11 AM
Please consider querystring support in 2.x - by El Forum - 07-28-2010, 11:42 AM
Please consider querystring support in 2.x - by El Forum - 07-28-2010, 03:32 PM
Please consider querystring support in 2.x - by El Forum - 07-28-2010, 03:39 PM
Please consider querystring support in 2.x - by El Forum - 07-28-2010, 03:58 PM
Please consider querystring support in 2.x - by El Forum - 07-29-2010, 01:47 PM
Please consider querystring support in 2.x - by El Forum - 07-29-2010, 04:36 PM
Please consider querystring support in 2.x - by El Forum - 07-29-2010, 06:19 PM
Please consider querystring support in 2.x - by El Forum - 07-29-2010, 07:03 PM
Please consider querystring support in 2.x - by El Forum - 07-29-2010, 10:25 PM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 12:26 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 12:56 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 01:09 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 01:28 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 01:36 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 03:54 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 10:34 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 11:31 AM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 03:09 PM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 04:51 PM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 04:52 PM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 06:10 PM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 08:35 PM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 08:41 PM
Please consider querystring support in 2.x - by El Forum - 07-30-2010, 10:20 PM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 02:35 AM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 05:57 AM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 06:07 AM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 07:34 AM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 09:40 AM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 10:08 AM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 07:08 PM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 09:50 PM
Please consider querystring support in 2.x - by El Forum - 07-31-2010, 11:50 PM
Please consider querystring support in 2.x - by El Forum - 08-01-2010, 01:27 AM
Please consider querystring support in 2.x - by El Forum - 08-01-2010, 01:42 AM
Please consider querystring support in 2.x - by El Forum - 08-01-2010, 03:00 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 04:37 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:01 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:06 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:17 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:28 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:31 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:39 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:45 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 05:54 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 06:03 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 06:15 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 09:04 AM
Please consider querystring support in 2.x - by El Forum - 08-02-2010, 10:57 AM
Please consider querystring support in 2.x - by El Forum - 08-03-2010, 10:56 PM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 01:09 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 01:19 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 01:40 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 02:06 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 02:08 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 02:18 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 02:37 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 02:39 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 03:51 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 04:01 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 04:55 AM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 12:50 PM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 02:55 PM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 04:47 PM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 06:00 PM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 06:55 PM
Please consider querystring support in 2.x - by El Forum - 08-04-2010, 07:08 PM
Please consider querystring support in 2.x - by El Forum - 08-07-2010, 12:04 AM
Please consider querystring support in 2.x - by El Forum - 08-07-2010, 09:31 AM
Please consider querystring support in 2.x - by El Forum - 08-23-2010, 02:13 PM
Please consider querystring support in 2.x - by El Forum - 08-23-2010, 02:30 PM
Please consider querystring support in 2.x - by El Forum - 08-23-2010, 02:31 PM
Please consider querystring support in 2.x - by El Forum - 08-23-2010, 03:41 PM
Please consider querystring support in 2.x - by El Forum - 08-23-2010, 05:09 PM
Please consider querystring support in 2.x - by El Forum - 08-23-2010, 06:36 PM
Please consider querystring support in 2.x - by El Forum - 08-24-2010, 01:32 PM
Please consider querystring support in 2.x - by El Forum - 08-24-2010, 01:32 PM
Please consider querystring support in 2.x - by El Forum - 08-25-2010, 05:33 PM
Please consider querystring support in 2.x - by El Forum - 08-25-2010, 06:51 PM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 12:48 AM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 05:51 AM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 10:16 AM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 10:16 AM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 11:19 AM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 12:28 PM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 02:27 PM
Please consider querystring support in 2.x - by El Forum - 08-26-2010, 04:34 PM
Please consider querystring support in 2.x - by El Forum - 08-27-2010, 01:32 AM
Please consider querystring support in 2.x - by El Forum - 08-27-2010, 02:21 AM
Please consider querystring support in 2.x - by El Forum - 08-27-2010, 07:36 AM
Please consider querystring support in 2.x - by El Forum - 08-27-2010, 02:52 PM
Please consider querystring support in 2.x - by El Forum - 08-27-2010, 04:15 PM
Please consider querystring support in 2.x - by El Forum - 09-02-2010, 03:08 AM
Please consider querystring support in 2.x - by El Forum - 09-02-2010, 07:46 AM
Please consider querystring support in 2.x - by El Forum - 09-02-2010, 08:30 AM
Please consider querystring support in 2.x - by El Forum - 09-02-2010, 11:53 AM
Please consider querystring support in 2.x - by El Forum - 09-02-2010, 03:41 PM
Please consider querystring support in 2.x - by El Forum - 11-14-2010, 04:58 PM
Please consider querystring support in 2.x - by El Forum - 11-14-2010, 05:01 PM
Please consider querystring support in 2.x - by El Forum - 11-14-2010, 05:33 PM
Please consider querystring support in 2.x - by El Forum - 11-14-2010, 10:28 PM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 04:57 AM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 10:19 AM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 10:29 AM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 10:47 AM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 10:53 AM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 11:11 AM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 11:23 AM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 01:39 PM
Please consider querystring support in 2.x - by El Forum - 11-15-2010, 04:00 PM
Please consider querystring support in 2.x - by El Forum - 04-25-2012, 06:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB