• Resolved Robert Peake

    (@robertpeake)


    This has just started in the last few releases:

    Fatal error: Can’t use function return value in write context in /path/to/wordpress/wp-content/plugins/varnish-http-purge/wp-cli.php on line 73

    May I suggest:

    if ( strlen(trim( esc_url( $url ) ) ) === 0 ) {

    on that line instead?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Robert Peake

    (@robertpeake)

    Plugin Contributor Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Please keep in mind that PHP 5.5 is end of life.

    A better fix:

    
    $url = esc_url( $url );
    if ( empty( $url ) ) {
    

    Since the issue is actually this:

    Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.

    That said, please do upgrade PHP as soon as possible for your own security and safety ??

    Edit: I will make that more back-compatible in 4.0.2 though.

    Thread Starter Robert Peake

    (@robertpeake)

    Like many enterprise operations that require stability over bleeding-edge features, we run CentOS 6.x, which adheres to the Red Hat Security Backporting policy: https://access.redhat.com/security/updates/backporting

    For this reason, we won’t be upgrading PHP anytime soon, nor are we at any risk of security problems. ??

    In fact, I heard recently that something like 15% of all WordPress installations are still at 5.3 or below. (Shocking, I know.)

    So, however you do it, probably good to include this minor fix in the next release, since we are almost certainly not the only ones experiencing this issue.

    Thread Starter Robert Peake

    (@robertpeake)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal Error in PHP < 5.5’ is closed to new replies.