liuch / dmarc-srg

A php parser, viewer and summary report generator for incoming DMARC reports.
GNU General Public License v3.0
223 stars 33 forks source link

error message with PHP 7.4 #124

Closed Dan33l closed 5 months ago

Dan33l commented 5 months ago

Hi,

The documented requirement is PHP 7.3 or higher. When i run utils/fetch_reports.php with PHP 7.4 (Ubuntu 20.04) i am getting the following error message :

dmarc-srg [error]: ErrorException: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /opt/dmarc/classes/Mail/MailMessage.php:111
Stack trace:
#0 /opt/dmarc/init.php(32): {closure}()
#1 /opt/dmarc/init.php(32): require_once()
#2 [internal function]: {closure}()
#3 /opt/dmarc/classes/Mail/MailBox.php(233): spl_autoload_call()
#4 /opt/dmarc/classes/Sources/MailboxSource.php(81): Liuch\DmarcSrg\Mail\MailBox->message()
#5 /opt/dmarc/classes/Report/ReportFetcher.php(113): Liuch\DmarcSrg\Sources\MailboxSource->current()
#6 /opt/dmarc/utils/fetch_reports.php(153): Liuch\DmarcSrg\Report\ReportFetcher->fetch()
#7 {main}
Error: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence (-1) 

All is working fine with PHP 8.1 (Ubuntu 22.04).

If lower requirement is PHP 8.0 i can propose a PR to modify the documented requirement.

Note : I had to install the mbstring module for PHP. I could add this dependency too in PR.

liuch commented 5 months ago

Hi @Dan33l, This issue was already fixed, see the details in #114

Note : I had to install the mbstring module for PHP. I could add this dependency too in PR.

Oh, I forgot to add it to the dependencies. I will do it. Thank you for your report!