PHP Syntax Error

Updated on November 1, 2018 in FuneralPress
5 on September 5, 2018

I updated my customer’s site to FuneralPress 2.9.5 and FP Premium 1.6.3 this morning. When I did, the site broke. Looking at my server logs, I was getting the following error post update:

PHP Parse error: syntax error, unexpected ‘@’ in /var/www/html/domains/www.chesmorefuneralhome.com/wp-content/plugins/wp-funeral-press/admin/manageCharity.php on line 124

Sure enough, I found that line 124 of that file had the following:

if(!empty(@$_POST[‘charityname’]))

I got the site running again by removing the @, but wanted you to be aware that there appears to be a syntax error going out in the current release.

  • Liked by
Reply
1 on September 11, 2018

Thanks for the bug tip, I will check that out!

on October 1, 2018

Hi Anthony,

We just did an update for this same customer and the same problem persists, breaking their site once again. I’ve re-patched the problem, but I would appreciate an update on when it will be addressed.

For more information —

I did do more digging on this and what I found is that is depends on the version of PHP that you are running as to whether this comes up as a syntax error or not.

This particular customer is running on stock RHEL7 which comes with PHP 5.4. When I run a “php -l manageCharity.php” on the command line on that server, I get the syntax error message as indicated.

If I copy the manageCharity.php file to another server that is running PHP 7.0 and do the same php -l command, it returns that there are not syntax errors detected. Clearly a change in behavior.

While PHP 7 is a great thing, I can’t migrate this customers site at the moment. However, since WordPress only requires PHP 5.2+, I think that making certain that FuneralPress runs cleanly under that would make sense.

It is the only instance of anything throughout the code that has this issue and since the @ is not used anywhere else in reference to POST vars in that function, its inclusion seem extraneous.

Thanks!

Show more replies
  • Liked by
Reply
Cancel
0 on October 1, 2018

Thanks for the report. We will look into and get it resolved

  • Liked by
Reply
Cancel
0 on October 5, 2018

Hi Anthony,

Just wondering if this fix was rolled into the latest 2.9.9 release? I checked the version details for the changelog via the plugin manager in WordPress, but it didn’t contain any current information.

Thanks!

  • Liked by
Reply
Cancel
0 on November 1, 2018

Hi Anthony —

Just about to do an update on my customer’s site and wondering if the issue above has been resolved before I update the FuneralPress plugin.

Thanks!
Richard

  • Liked by
Reply
Cancel
Loading more replies