elkarte / Elkarte

ElkArte Forum. A free, open source, modern discussion forum / BB
https://elkarte.github.io/Elkarte/
BSD 3-Clause "New" or "Revised" License
176 stars 61 forks source link

Problem in EmailParse.class.php #3709

Closed JoergPalmer closed 1 year ago

JoergPalmer commented 1 year ago

In function _process_DSN() there is a check for an optional parameter "TYPE", following the pattern "FIELD: [TYPE;] VALUE"

The check is done with (706) if (strpos($line, ';'))

Instead it should be checked like: (706) if (strpos($line, ';') !== false)

In my forum I was running on an error. As mentioned in php.net documentation, checking the return value of strpos() should always be explicitly checked against 'false' with the "===" operator (or "!==" for the matter).

With this change I can prevent this error from happening. Maybe it's of general interest to correct this in the official code.

Spuds commented 1 year ago

Thank you for the report. I'll make the change in 1.1.10 as well as 2.0