I have a custom Convert Forms PHP script that has worked for years that suddenly no longer does. It fails on a call to $mailer->addRecipient($email_address). The error it reports is "Prohibited input U+0000002C", which indicates there is a comma in $email_address, when that is absolutely not the case.
6.1.2
I expect the addRecipient() call to work as it has for the past 3 years and the subsequent email to be sent and not make my script fail.
I have gone as far as "cleaning" $email_address to ensure there are no hidden characters, but nothing made a difference. This error is causing my script to die at this point. Enabling debug and maximum error reporting provided no traceback or other information.
| Setting | Value |
| Joomla! Version | Joomla! 6.1.2 Stable [ Nyota ] 7-July-2026 16:00 UTC |
| Joomla Backward Compatibility Plugin | Enabled (classes_aliases:"1", legacy_classes:"1") |
| PHP Version | 8.3.31 |
| PHP Built On | Linux na8861.serversignin.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 |
| Database Type | mysql |
| Database Version | 11.4.12-MariaDB |
| Database Collation | utf8mb4_unicode_ci |
| Database Connection Collation | utf8mb4_general_ci |
No response
| Labels |
Added:
No Code Attached Yet
bug
|
||
We've had this before. You should be able to find it with search.
I searched here for that character code but got no result. I would think that should be the unique identifier for a search. Otherwise, if you have another keyword...
Search for prohibited input in both issues and pr including closed
Search for prohibited input in both issues and pr including closed
I can see why that tickled a memory for you, Brian, but those other cases are unrelated to the Mailer class (except one very old one for setSender, which is not the method involved here; that part seems to be working).
@brucescherzinger Wrap your code inside \Joomla\CMS\MailMailHelper::isEmailAddress($email_address) check and you should be safe. Something with Punycode, but I do not remember exactly what's the list of forbidden characters
\Joomla\CMS\MailMailHelper::isEmailAddress($email_address)
I am already doing this. Is this not sufficient?
$submitter_email = filter_var($requested->submitter_email, FILTER_SANITIZE_EMAIL);
\Joomla\CMS\Mail\MailHelper::isEmailAddress($email_address)
I am already doing this. Is this not sufficient?
$submitter_email = filter_var($requested->submitter_email, FILTER_SANITIZE_EMAIL);
Your recommended check yielded 1.
If it helps the problem is a , comma in an email address
If it helps the problem is a , comma in an email address
I'm aware. There is no comma.
$submitter_email = filter_var($requested->submitter_email, FILTER_SANITIZE_EMAIL);
I never used that myself, so honestly, I do not know. I guess that filter will only remove invalid characters from the variable, the returned string might still not a valid email. You better use MailHelper::isEmailAddress check as I suggested earlier
Interesting...apparently, my debug statement was not well-placed enough. It was actually dying on addCC, the input parameter for which DID include a comma. Apologies for the runaround.
THIS TICKET CAN BE CLOSED.
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-07-29 14:43:58 |
| Closed_By | ⇒ | joomdonation |
Great, thanks for the update. I'm closing the issue
glad you fixed it
One thing I did notice when looking at the core code in Mail.php is that if a single (non-array) address is passed into addRecipient (likely others), the add() method does not bother to process the name parameter as an array (or in any other way). It simply passes it along to \call_user_func (line 303), which could cause issues if someone does pass name as an array. Maybe not a big deal, but just something I noticed.
We've had this before. You should be able to find it with search.