-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect comparison for LOADER_URI
This resulted in every page being treated as "not the loader", which had two subtle consequences: 1. All errors would go to the external error.php page rather than the internal redirection within the loader (e.g. current sector). 2. All HREFs would be absolute paths, where they should typically be relative (i.e. just the query string when in the loader). Looking at the documentation for `$_SERVER`, we don't want to use the `REQUEST_URI`, because this includes the query string. Here are some of the values on a regular page: 'REQUEST_URI' => '/loader.php?sn=gwbdpa', 'SCRIPT_NAME' => '/loader.php', 'PHP_SELF' => '/loader.php', As we can see, either `PHP_SELF` or `SCRIPT_NAME` should work for our purposes. Another benefit of this is that the NPC script will do the correct thing now as well. Previously, it couldn't handle errors properly because CLI scripts don't define `REQUEST_URI`, but we do have: 'SCRIPT_NAME' => 'src/tools/npc/npc.php', 'PHP_SELF' => 'src/tools/npc/npc.php', Again, either of these work, because we do _not_ want it to behave as if it is in the loader.
- Loading branch information
Showing
4 changed files
with
5 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters