Issue reported: https://forum.joomla.de/thread/7135-badwords-in-kontaktformular-funktionieren-nicht/
Go to: components > contacts > contacts
Contact Form > show (activated)
Fill in the contact form with banned words.
Form:
Banned Subject: badword1;badword2;
Banned Text: badword1;badword2;
Contact form should not be sent.
Contact form sent.
There is no message either.
The test for these are done in
/components/com_contact/models/rules/contactemailsubject.php
and
/components/com_contact/models/rules/contactemailmessage.php
Where $params are only fetched from the component.
@infograf768 Thank you for your info: "to set in Global Options. Will check it.
Concerning 2nd reply: how should it be tested? Do we have to check also the php files?
The /components/com_contact/models/forms/contact.xml contains:
<field
name="contact_subject"
type="text"
label="COM_CONTACT_CONTACT_MESSAGE_SUBJECT_LABEL"
description="COM_CONTACT_CONTACT_MESSAGE_SUBJECT_DESC"
id="contact-emailmsg"
size="60"
filter="string"
validate="contactemailsubject"
required="true"
/>
<field
name="contact_message"
type="textarea"
label="COM_CONTACT_CONTACT_ENTER_MESSAGE_LABEL"
description="COM_CONTACT_CONTACT_ENTER_MESSAGE_DESC"
cols="50"
rows="10"
id="contact-message"
filter="safehtml"
validate="contactemailmessage"
required="true"
/>
As one can see, the validation comes from the files I noted in
#23546 (comment)
To solve this, we would need to merge the params from the contact itself, then the params from the menu item displaying the contact to the Component params in these files where we only have:
$params = JComponentHelper::getParams('com_contact');
Looking into it here. Not sure I can solve. Will try.
Confirmed.
It is only working if set in com_contacts Global Options.
In that case, one gets an invalid field error for Message
Just tested. Confirm above. Options > Form > Banned Subject / Banned Text
Message:
Fehler
Ungültiges Feld: Betreff
Ungültiges Feld: Nachricht
same for banned_email
Grr
Making a PR now.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-01-16 17:21:52 |
Closed_By | ⇒ | infograf768 |
@ChristineWk
Please inform also https://forum.joomla.de/thread/7135-badwords-in-kontaktformular-funktionieren-nicht/ about the PR to test.
@infograf768 Thank you! Tested PR#23569 and will inform forum accordingly
Confirmed.
It is only working if set in com_contacts Global Options.
In that case, one gets an invalid field error for Message