You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I access the index.php that includes Toro.php from a URL with no path it works fine. Here's an example:
mytest.com/
If, however, I access an index.php file that is inside of a directory or two, it fails. Here's an example of that (my index is in /var/www/some/directory/index.php).
mytest.com/some/directory/
What I've found is that the last test in Toro.php that looks at the $_SERVER['REQUEST_URI'] is the problem. That variable returns "/some/directory/" in the case of my script being setup inside a directory. As a result the "/" route fails to work, but the others do work. Here's the failing route code.
By removing the last for $_SERVER['REQUEST_URI']) the problem goes away (because '/' is the default $path_info value).
So, my question is, what does that last $_SERVER['REQUEST_URI'] add that I'm missing here? Should it be removed or put in as an option? If so, I'm happy to make these changes and submit a pull request.
The text was updated successfully, but these errors were encountered:
Hello. I can confirm this issue as well. removing the last else block (18 line) resolves it, but not sure if it won't cause trouble is some other situation...
@sijad@kutchbhi You have several options how to fix it I'm using this:
Toro.php
$uri = @explode('/', $_SERVER['REQUEST_URI'])[2]; //Here you need to find your dir or use GET
$path_info = ((!empty($uri)) ? $path_info = '/'.$uri : $path_info = '/');
If I access the index.php that includes Toro.php from a URL with no path it works fine. Here's an example:
If, however, I access an index.php file that is inside of a directory or two, it fails. Here's an example of that (my index is in /var/www/some/directory/index.php).
What I've found is that the last test in Toro.php that looks at the $_SERVER['REQUEST_URI'] is the problem. That variable returns "/some/directory/" in the case of my script being setup inside a directory. As a result the "/" route fails to work, but the others do work. Here's the failing route code.
If I change the code to the following, it works.
By removing the last for $_SERVER['REQUEST_URI']) the problem goes away (because '/' is the default $path_info value).
So, my question is, what does that last $_SERVER['REQUEST_URI'] add that I'm missing here? Should it be removed or put in as an option? If so, I'm happy to make these changes and submit a pull request.
The text was updated successfully, but these errors were encountered: