09-07-2016, 06:34 PM
OK, changes done. See here for Redirect.php
http://pastebin.com/yvSx71U1
These changes are as follows:
(1) allow arguments as an optional second argument:
(2) Fix problems with relative paths where sometimes the redirect is to users/script.php and other times it is to script.php and if you are not already set in the users directory it can cause problems
(3) clean up some tabbing so code aligns better and is more readable
I *believe* that with all 3 of these changes (Redirect.php, us_helpers.php, and login.php) the original bug is fixed along with the problem with the relative paths in Redirect.
Do note that in the long term it would be better if all Redirects use $us_url_root.'path/to/script.php' instead of just 'to/script.php'. This would remove the ambiguity that my fix is trying to solve...
http://pastebin.com/yvSx71U1
These changes are as follows:
(1) allow arguments as an optional second argument:
Code:
Redirect::to('login.php', '?err=Error+Message');
(3) clean up some tabbing so code aligns better and is more readable
I *believe* that with all 3 of these changes (Redirect.php, us_helpers.php, and login.php) the original bug is fixed along with the problem with the relative paths in Redirect.
Do note that in the long term it would be better if all Redirects use $us_url_root.'path/to/script.php' instead of just 'to/script.php'. This would remove the ambiguity that my fix is trying to solve...