• Hi!

    If WP Cron is being called from CLI, variable $_SERVER[‘REQUEST_METHOD’] is not being set and then iThemes Security generates this all the time:
    PHP Notice: Undefined index: REQUEST_METHOD in /wp-content/plugins/better-wp-security/core/modules/ssl/class-itsec-ssl.php on line 72

    Probably need to add additional check if this variable is set before checking it’s value.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Nice one …

    No need for an additional check. Simply change the order of the conditions in the class-itsec-ssl.php file from :

    } else if ( 'enabled' === $settings['require_ssl'] &&
                   'GET' === $_SERVER['REQUEST_METHOD'] &&
                     ( ! defined( 'WP_CLI' ) || ! WP_CLI ) ) {

    to:

    } else if ( 'enabled' === $settings['require_ssl'] &&
                  ( ! defined( 'WP_CLI' ) || ! WP_CLI ) && 
                      'GET' === $_SERVER['REQUEST_METHOD'] ) {

    This way the last condition won’t be evaluated in a CLI request.

    Allthough unmentioned in the 7.0.0 Changelog this issue was fixed (exactly as described in my previous post) in the 7.0.0 release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Undefined index: REQUEST_METHOD’ is closed to new replies.