libraries/Router.php Bug |
[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: /** Is this a valid bug in the CI_Router class?
[eluser]imn.codeartist[/eluser]
shouldn't have a problem as I tried passing extra spaces in the url didn't give me any errors
[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.
[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 |
Welcome Guest, Not a member yet? Register Sign In |