SUGAREMAILADDRESS error, the variable $addr is empty and it creates logs when it should not #577
Labels
Priority:Important
Issues & PRs that are important; broken functions; errors; there are workarounds
Severity: Moderate
Minor Impact
Type: Bug
Something isn't working
Issue
here is the relevant log
Thu Nov 28 14:52:10 2024 [1755559][d66ee7cb-4e64-75a0-2af5-5eb900163da3][FATAL] SUGAREMAILADDRESS: address did not valid [ ]
we see that there is nothing between the square brackets, even though the content of the $addr variable should be there.
if we look at the relevant code in the public/legacy/include/SugarEmailAddress/SugarEmailAddress.php file, we see that
it generates an error log with the variable $addr if the regex is not validated
we should not get a log if $addr is empty, in fact i suspect we should not even step into this function.
Possible Fix
we could add a check for the empty of the variable $addr like so
Steps to Reproduce the Issue
Context
No response
Version
8.7.0
What browser are you currently using?
Firefox
Browser Version
133.0 (64-bit)
Environment Information
PHP 8.2, Mysql 5.7.33
Operating System and Version
Windows 11 23H
The text was updated successfully, but these errors were encountered: