• Resolved mojamba

    (@mojamba)


    I get the following in my errors_log file:

    Undefined array key “REQUEST_METHOD” in …/wp-content/plugins/pretty-link/app/controllers/PrliAppController.php on line 33

    Not a big deal but would be good if you fixed that for the next update.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Tyler

    (@tylerthedude)

    Hi there,

    Could you please let me know what action happens right before this warning is triggered? In most cases, the request method should be available unless the site is being accessed outside of the browser.

    Kind regards,

    Thread Starter mojamba

    (@mojamba)

    I cannot answer your question because it is a warning that I am merely noticing in my error_log file. I wouldn’t notice it browsing my site anyway as I don’t have PHP errors set for that. But it should be a simple fix on your end (check that exists first I would think).

    Tyler

    (@tylerthedude)

    Hi there,

    Unfortunately, I haven’t been able to replicate this. Are you using a server-side cron instead of the WordPress cron? However, I’ll get with our development team about adding a check to ensure that $_SERVER[‘REQUEST_METHOD’] is set before using it.

    Kind regards,

    Thread Starter mojamba

    (@mojamba)

    Yes, actually, I am using a server-side cron.

    Tyler

    (@tylerthedude)

    Hi there,

    Thank you for checking that. In the meantime, could you try adding this line to your site’s wp-config.php file and see if that prevents those notices from getting logged?

    $_SERVER['REQUEST_METHOD'] = array_key_exists( 'REQUEST_METHOD', $_SERVER ) ? $_SERVER['REQUEST_METHOD'] : 'GET';

    Kind regards,

    Thread Starter mojamba

    (@mojamba)

    I added it but still getting the error notices.

    Tyler

    (@tylerthedude)

    Hi there,

    Thank you for trying that. If you have access to your site’s filesystem through something like cPanel or FTP, could you please open the PrliAppController.php file under wp-content/plugins/pretty-link/controllers/ and then on line 33 replace this line:

    if($_SERVER["REQUEST_METHOD"] == 'GET' && !is_admin()) {

    With this:

    if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER["REQUEST_METHOD"] == 'GET' && !is_admin()) {

    And see if that removes the notice?

    Kind regards,

    Thread Starter mojamba

    (@mojamba)

    Yes, that seems to have fixed things.

    Tyler

    (@tylerthedude)

    Hi there,

    I just wanted to follow up on this thread and let you know that we’ve released a new version of Pretty Links that includes a fix for this warning, so if you haven’t already please upgrade to this version (3.3.0) and the warning will no longer be logged going forward.

    Kind regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘PHP Warning’ is closed to new replies.