Welcome Guest, Not a member yet? Register   Sign In
spaces in URLs converted to _
#21

[eluser]sophistry[/eluser]
here is the standard set of permitted uri chars:
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

note that the only thing that this config item is used for is in the URI.php lib where it either accepts or rejects the URI and passes it on.

Code:
/**
     * Filter segments for malicious characters
     *
     * @access    private
     * @param    string
     * @return    string
     */    
    function _filter_uri($str)
    {
        if ($str != '' AND $this->config->item('permitted_uri_chars') != '')
        {
            if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
            {
                exit('The URI you submitted has disallowed characters.');
            }
        }
            
        return $str;
    }

so, the problem isn't with the permitted chars because otherwise you would be getting a "this URI has disallowed chars" message.

the problem is elsewhere.

i found this little quizzical note in the Input.php lib. maybe that will help?
Code:
/*
         * URL Decode
         *
         * Just in case stuff like this is submitted:
         *
         * <a href="http://www.google.com">Google</a>
         *
         * Note: Use rawurldecode() so it does not remove plus signs
         *
         */
        $str = rawurldecode($str);
#22

[eluser]AtlantixMedia[/eluser]
thanks for the info. I would love to say it is working. however, it is still not working (I used raswurldecode() as suggested). I'm going nuts....
#23

[eluser]sophistry[/eluser]
i tested the code you posted, adding the plus sign to the permitted chars and i got the string with the plus sign in it - it was not changed to an underscore.

CI 1.62, fresh code install.

do a fresh test install and post results. if you still see chars changing from plus to underscore then something else is in the pipeline doing it.

good+luck! :-)
#24

[eluser]AtlantixMedia[/eluser]
I already upgraded to 1.62...anyway...I installed a fresh copy on another domain - same server....and now all I get is a 404 when I try to reach a test controller. I'm only able to get the welcome page....

Code:
Not Found
The requested URL /test/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
#25

[eluser]AtlantixMedia[/eluser]
hold on..now it works (the controller)......go figure......

I ran the same test, still, + are converted to _. I just want to make sure we are running the same test here:

test.php controller
Code:
&lt;?php

class Test extends Controller {

    function Test()
    {
        parent::Controller();    
    }
    
    function index()
    {
        //$this->load->view('welcome_message');
    }

    function query($query)
    {
    echo $query; die;
    }

}

?&gt;

config.php
Code:
$config['permitted_uri_chars'] = "+a-z 0-9~%.:_'-";

URI to test: http://www.yourdomain.com/test/query/wil...+ever+work


I get will_this_ever_work.


however, if I put this file in the root and run it outside of CI, it works:



test.php
Code:
&lt;?php

echo $_GET['q'] . '<br />';

?&gt;
<a href="&lt;?php echo htmlentities('http://www.yourdomain.com/test.php?q=will this ever work');    ?&gt;">click</a><br />
<a href="&lt;?php echo 'http://www.yourdomain.com/test.php?q=will+this+ever+work';    ?&gt;">click</a><br />

please someone shed some light on this. I need to get it fixed fast. thanks
#26

[eluser]sophistry[/eluser]
talk to your hosting provider; they might have some kind of filtering in place to change plus to underscore when it is sent as part of the URI rather than as part of a GET query.

to test that idea, see what happens when you call something like this outside of CI:

http://www.yourdomain.com/NOT_in_CI/will.../index.php
#27

[eluser]barbazul[/eluser]
@sophistry: That's what he said he did in his last post.

Have you tried using $this->uri->segment() instead of a method parameter.

It should be the same but then again... the whole thing is so mysterious it might actually work Big Grin
#28

[eluser]sophistry[/eluser]
@barbazul - i asked atlantix to do two things... i'm not sure which one you are referring to.

1) check whether the URL gets to a directory with spaces in it when the dir+with+spaces+in+it is in the URI path rather than a segment at the end of it - that's clearer, right?

2) ask the hosting provider? i haven't seen any feedback posted about the hosting provider - i think they are filtering paths to change them.

my $0.02.
#29

[eluser]barbazul[/eluser]
@sophistry:
LOL, I was referring to number 1

anyway, I misunderstood your suggestion. thought you were referring to something like:
http://www.yourdomain.com/NOT_IN_CI/test...+ever+work
which he said he already tried.

@AtlantixMedia:
so, there you have it, you should try sophistry's suggestions and I would add the uri->segment() thingy to the list
#30

[eluser]AtlantixMedia[/eluser]
sorry for the late reply:

sophistry:

I'm not sure I understand the test you are suggesting....I created a NOT_IN_CI folder outside of CI and I'm able to get to it through the url.....

I recently changed hosting provider. Still, I'm experiencing the same issue. I will ask them.

barbazul:

I tried your suggestion regarding using segments, with no success.




Theme © iAndrew 2016 - Forum software by © MyBB