File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ function isLive() {
100100define ('ERROR_CODE ' , 1 );
101101define ('EXPLANATION ' , 2 );
102102
103- $ errorcodes = json_decode (file_get_contents (' ./errpages/ httperror.json ' ), true );
103+ $ errorcodes = json_decode (file_get_contents (getenv ( ' ERRPAGE_JSON_PATH ' ) . ' httperror.json ' ), true );
104104
105105if (@$ errorcodes ["{$ http_status }" ]) {
106106 $ error_code = $ errorcodes ["{$ http_status }" ][ERROR_CODE ];
Original file line number Diff line number Diff line change 22// this script is for testing ./errpages/httperror.php, just
33// change the code below
44$ testcode = 401 ;
5+ // NOTE: The version of httperror.php that uses a JSON file
6+ // for error code content does not use this. Typically this
7+ // was used only for 404 errors.
8+ $ _SERVER ['REQUEST_URI ' ] = '/bad_path/no_resource ' ;
59// this just proves we can overwrite $_SERVER
610$ _SERVER ['HTTPS ' ] = 'on ' ;
711$ _SERVER ['SERVER_PORT ' ] = 443 ;
812// get the code to httperror.php...
913putenv ("REDIRECT_STATUS= {$ testcode }" );
1014// test!
15+ putenv ("ERRPAGE_JSON_PATH=./errpages/ " );
1116require_once './errpages/httperror.php ' ;
17+ //require_once './errpages/_test.php';
1218?>
You can’t perform that action at this time.
0 commit comments