• Resolved arielmerrell

    (@arielmerrell)


    Hi Everyone,

    Not sure if it was an update or if my host upgraded something, but site will not load and it seems to revolve around this function in the src directory of the plugin folder.

    I patched it just to get the site working by removing that string array, but could someone tell me what it is supposed to be or could something have changed on my server that makes this syntax not valid anymore?

    function hf_human_filesize($size, $precision = 2) {
    for($i = 0; ($size / 1024) > 0.9; $i++, $size /= 1024) {}
    return round($size, $precision).[‘B’,’kB’,’MB’,’GB’,’TB’,’PB’,’EB’,’ZB’,’YB’][$i];
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Ariel,

    Good catch! That function is using the “short array syntax” which is only available in PHP versions 5.4 and later. Most likely, your server is running PHP v5.3.x?

    We’re fixing this in the plugin, but I highly recommend upgrading to PHP 7.2 as well. It will greatly speed up and future-proof your site.

    Cheers, Danny

    Thread Starter arielmerrell

    (@arielmerrell)

    Hi Danny,

    Thanks for the response. We were running PHP 5.4. I found a PHP Selector in our cPanel and have selected 7.1. 7.2 is not yet available through my host. All seems to be working with that function back to normal.

    Thanks a bunch. Just starting to really play with the plug-in. Liking it a lot.

    Kind Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Functions causing unexpected [ error’ is closed to new replies.