Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

PHP warning: Undefined array key "xrouting-debug" #47

Open
devWhitevision opened this issue May 31, 2024 · 0 comments
Open

PHP warning: Undefined array key "xrouting-debug" #47

devWhitevision opened this issue May 31, 2024 · 0 comments

Comments

@devWhitevision
Copy link

The problem is that the code is trying to access the array key xrouting-debug in the $_REQUEST array, but this key does not exist. This leads to an ‘Undefined array key’ error.

To correct this error, you should check whether the key exists before accessing it. You can do this with the isset or array_key_exists function. Here is a possible solution for your code:

Line 146:
if (isset($_REQUEST['xrouting-debug']) && $_REQUEST['xrouting-debug'] == '1' && $modx->getOption('xrouting.allow_debug_info', null, false)) {
Tested on Modx 2.8.7, PHP 8.1.x, System setting xrouting.allow_debug_info = No;

Best regards,
Stefan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant