Welcome Guest, Not a member yet? Register   Sign In
libraries/Router.php Bug
#1

[eluser]Unknown[/eluser]
Hello,

I found that if we try to visit any CI controller with spaces in the URL (i.e. http://www.example.com/abc/ ), it will give a notice error in libraries/Router.php file on Lines 201, 207, and 210.

The problem was in the _validate_request() method in CI_Router class. I added the following code to the beginning of that function to fix the problem:
Code:
/**
* Bug Fix
*/
        if (count($segments) < 1)
        {
            $segments = array('');
        }
/**
* End
*/

Is this a valid bug in the CI_Router class?
#2

[eluser]imn.codeartist[/eluser]
shouldn't have a problem as I tried passing extra spaces in the url didn't give me any errors
#3

[eluser]Unknown[/eluser]
Ok, you can try the following:

- Go to: http://cateus.org/ci_test/ and you will get the default welcome controller without any issue.

- Now add two spaces ( ) to the url, or click on the "Click here" link in that page, and you will get the notice errors that I am talking about.
#4

[eluser]imn.codeartist[/eluser]
[quote author="Hassan Sunbul" date="1256207321"]Ok, you can try the following:

- Go to: http://cateus.org/ci_test/ and you will get the default welcome controller without any issue.

- Now add two spaces ( ) to the url, or click on the "Click here" link in that page, and you will get the notice errors that I am talking about.[/quote]

i right clicked your url and it gave me this http://cateus.org/ci_test/% 2 0 % 2 0 (I have given space because its printing out)

so basically use trim command to remove white space as you dont have to modify the router.php




Theme © iAndrew 2016 - Forum software by © MyBB