• Resolved Devonto

    (@devonto)


    Hello,

    I’m seeing a PHP warning to the PHP log when browsing the admin of a site.

    PHP message: PHP Warning: Undefined array key "rest_route" in .../public/wp-content/plugins/stellarpay/src/Integrations/WooCommerce/FeatureSupport/ReactBasedPaymentSettings.php on line 114

    Checking the source within the isWoocommerceAdminPaymentsProviderRestApiRequest() function on line 110, there’s an assumption that $GLOBALS['wp']->query_vars['rest_route'] exists on line 114.

    Above this line, there is a check of:

    if (!WC()->is_rest_api_request()) {
    return false;
    }

    Can this be expanded to also check the variable exists? e.g.

    if (!WC()->is_rest_api_request() || empty( $GLOBALS['wp']->query_vars['rest_route'] )) {
    return false;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @devonto,

    Glad you reached out, and thanks for reporting this!

    While we haven’t been able to reproduce the issue on our end, we’ve prepared a fix to address it proactively, and it should be released soon. I’ll circle back here once it’s been deployed.

    We appreciate your patience!

    Thread Starter Devonto

    (@devonto)

    Thanks, appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Undefined array key “rest_route”’ is closed to new replies.