Re: php scripts and tripple slashes



"Erwin Moller" <Since_humans_read_this_I_am_spammed_too_much@xxxxxxxxxxxxxxxx> schreef in bericht news:48e0d358$0$182$e4fe514c@xxxxxxxxxxxxxxxxx

mijn naam schreef:
"Erwin Moller" <Since_humans_read_this_I_am_spammed_too_much@xxxxxxxxxxxxxxxx> schreef in bericht news:48e0cabf$0$185$e4fe514c@xxxxxxxxxxxxxxxxx

I bet you are using mod_rewrite for apache.
Have a look at the rewrite rules and conditions in your apache config.
Post it here if you are in doubt. Or better here: alt.apache.configuration

Thanks but no.

One machine is the provider's. I cannot look there.

The other one is my home box, this one doesn't do rewriting AFACT. Just to be sure: I placed RewriteLogLevel 2 and RewriteLog logs/rewrite in the config and that log stays empty.

Then I commented everything having to do with rewriting out, and restarted apache. Before and after the following happens on my machine:

_SERVER["REQUEST_URI"]=/debug/one/two///three/four
_SERVER["SCRIPT_NAME"]=/debug/one/two/debug.php
_SERVER["PHP_SELF"]=/debug/one/two/debug.php/one/two/three/four


Hi Stranger,

And what URL are you feeding excactly that gives the above result?

http://hostname/debug/one/two///three/four

in other words: http://{$_SERVER["SERVER_NAME"]}{$_SERVER["REQUEST_URI"]}


And secondly: What is it excactly you are trying to achieve?
Do you have an actual problem or is this just research?

I'm writing a script which is going to be used to find files in a directory structure. That script looks like a subdirectory in the normal tree.

E.g. http://servername/content/a/b/c/d will look at /home/user/private_html/a/b/c/d

While testing my script with various different problems ('never trust user input') I found the problem I'm trying to tackle.

I was using _SERVER["SCRIPT_NAME"] but obviously I run into trouble if I can't rely on its contents.

The only workaround I've found so far is to redirect(ereg_replace('///*','/',$_SERVER["REQUEST_URI"])) in case I find two slashes in a row in request_uri. Not a nice solution but it seems to do the job.


PS: Please 'mijn naam', use a (real) name, that makes conversations in here a bit more pleasant. ;-)

Just call me 'Mijn'. No problem.

.



Relevant Pages

  • Re: php scripts and tripple slashes
    ... Have a look at the rewrite rules and conditions in your apache config. ... Then I commented everything having to do with rewriting out, ... DOESN'T name any php script, so HOW is this fed to a PHP script without mod_rewrite??? ...
    (comp.lang.php)
  • Re: php scripts and tripple slashes
    ... Have a look at the rewrite rules and conditions in your apache config. ... Then I commented everything having to do with rewriting out, ... Erwin Moller ... Please 'mijn naam', use a name, that makes conversations in here a bit more pleasant. ...
    (comp.lang.php)
  • Re: php scripts and tripple slashes
    ... "Erwin Moller" ... Have a look at the rewrite rules and conditions in your apache config. ... Then I commented everything having to do with rewriting out, ...
    (comp.lang.php)
  • Re: Script File Error
    ... Ivailo Tanusheff wrote: ... You may correct the script by changing: ... I corrected it by rewriting it like ... Never argue with a fool. ...
    (freebsd-questions)
  • Re: CGI -> mod_python
    ... it is a kind of nooby question. ... Is there a way to transfer a CGI python ... script to mod_python without rewriting the code? ...
    (comp.lang.python)