WordPress.org

Forums

Published Articles Since Last Visit
[resolved] Incompatible with PHP 5.4.x (3 posts)

  1. Anthony Somerset
    Member
    Posted 2 years ago #

    I just upgraded a client site from php 5.3.x to 5.4.11 and getting the following error now

    Fatal error: Cannot re-assign auto-global variable _COOKIE in /home/<REDACTED>/public_html/wp-content/plugins/published-articles-since-last-visit/class.gaparse.php on line 32

    upon doing some digging, the behaviour matches this bug report for PHP: https://bugs.php.net/bug.php?id=54657

    http://wordpress.org/extend/plugins/published-articles-since-last-visit/

  2. kitchin
    Member
    Posted 2 years ago #

    Yeah, PHP intentionally is no longer allowing that. http://www.php.net/manual/en/migration54.incompatible.php Same goes for $_GET, $_POST, $_REQUEST, etc. Here is a fix for this plugin.

    class.gaparse.php:

    function __construct($_COOKIE) {
           $this->utmz = $_COOKIE["__utmz"];
           $this->utma = $_COOKIE["__utma"];
           $this->ParseCookies();
      }

    change to:

    function __construct($cookie) {
           $this->utmz = $cookie["__utmz"];
           $this->utma = $cookie["__utma"];
           $this->ParseCookies();
      }
  3. Anthony Somerset
    Member
    Posted 2 years ago #

    can confirm this fixes for me

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Published Articles Since Last Visit
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic