hypothesis / wp-hypothesis

Hypothesis WordPress plugin
https://wordpress.org/plugins/hypothesis/
Other
29 stars 14 forks source link

PHP <5.4 compatibility problems #23

Closed nickstenning closed 7 years ago

nickstenning commented 7 years ago

Relaying a report from our support email address:

After I updated the Hypothes.is plugin on my Wordpress website to the version mentioned above, it was not accessible anymore. I had to delete the plugin folder via my FTP access; that restored service immediately. The error message I found in my server logs was:

mod_fcgid: stderr: PHP Parse error: syntax error, unexpected '[' in /var/www/vhosts/wordpress.karstens.eu/httpdocs/wp-content/plugins/hypothesis/hypothesis.php on line 409

I'm not sure, but I'd guess this is a result of https://github.com/hypothesis/wp-hypothesis/commit/1f8a0c6a7cf03280fe4c17ed067aaebb50aa3deb, which replaced array() with [] in a number of places.

It appears that this short syntax for arrays was only introduced in PHP 5.4: https://secure.php.net/manual/en/language.types.array.php#syntax

We should either revert that part of the change, or clearly document that we only support PHP>=5.4.

Do you think you might have time to look at this, @greatislander?

greatislander commented 7 years ago

@nickstenning I'll release an update on WP.org with this fix later today.

judell commented 7 years ago

@nickstenning thanks for catching this, and @greatislander thanks for fixing!