?
avatar ChristineWk
ChristineWk
15 Jan 2019

Issue reported: https://forum.joomla.de/thread/7135-badwords-in-kontaktformular-funktionieren-nicht/

Steps to reproduce the issue

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;

Expected result

Contact form should not be sent.

Actual result

Contact form sent.
There is no message either.

System information (as much as possible)

Additional comments

avatar ChristineWk ChristineWk - open - 15 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Jan 2019
avatar infograf768
infograf768 - comment - 15 Jan 2019

Confirmed.
It is only working if set in com_contacts Global Options.
In that case, one gets an invalid field error for Message

avatar infograf768
infograf768 - comment - 15 Jan 2019

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.

avatar ChristineWk ChristineWk - change - 15 Jan 2019
The description was changed
avatar ChristineWk ChristineWk - edited - 15 Jan 2019
avatar ChristineWk
ChristineWk - comment - 15 Jan 2019

@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?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23546.
avatar infograf768
infograf768 - comment - 15 Jan 2019

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.

avatar ChristineWk
ChristineWk - comment - 15 Jan 2019

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

avatar infograf768
infograf768 - comment - 15 Jan 2019

same for banned_email
Grr

avatar infograf768
infograf768 - comment - 16 Jan 2019

Making a PR now.

avatar infograf768
infograf768 - comment - 16 Jan 2019

Please test #23569
closing as we have a PR

avatar infograf768 infograf768 - change - 16 Jan 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-01-16 17:21:52
Closed_By infograf768
avatar infograf768 infograf768 - close - 16 Jan 2019
avatar infograf768
infograf768 - comment - 16 Jan 2019
avatar ChristineWk
ChristineWk - comment - 16 Jan 2019

@infograf768 Thank you! Tested PR#23569 and will inform forum accordingly

Add a Comment

Login with GitHub to post a comment