Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: REQUEST_METHOD when WP is called from CLI #44

Open
archon810 opened this issue Feb 18, 2017 · 0 comments
Open

Undefined index: REQUEST_METHOD when WP is called from CLI #44

archon810 opened this issue Feb 18, 2017 · 0 comments

Comments

@archon810
Copy link

Hi,

Using the latest version 4.2.3 of the plugin and with notices enabled, I'm seeing only one notice in our environment, but it repeats thousands of times for us because we have a script loading WP and doing some stuff on the command line, and wp-advanced-excerpt doesn't check for the definition here:

if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_REQUEST['page'] ) && 'advanced-excerpt' === $_REQUEST['page'] ) {

That's line 41 of advanced-excerpt/class/advanced-excerpt.php.

Undefined index: REQUEST_METHOD

The script that calls this from command line does this:

if (file_exists(__DIR__ . '/../../../../wordpress/wp-load.php')) {
    require_once(__DIR__ . '/../../../../wordpress/wp-load.php');
}

I'd rather not have to fix the code locally and keep a forked copy, so I'm hoping you can do so in the main repo and release an update.

Thanks.

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

No branches or pull requests

1 participant