Forums

PHP preg_replace bug when adding special chars like slash to field name

Dennis Heiden 16 Mar, 2014
When you add special chars like a slash to the field name, you will get an error:

Field name: /F

Warning
:preg_replace(){function.preg-replace
]: Unknown modifier "F" in ...libraries/cegcore/helpers/data_loader.php
on line 175
GreyHead 16 Mar, 2014
HI Dennis,

I'm pretty certain that slashes are not permitted in HTML input names, or is this problem with the Label?

Bob
Dennis Heiden 17 Mar, 2014
No, it is the field name input only, and yes you are right with HTML, but maybe there should be a check function behind such fields to prevent "ugly" errors, like deleting HTML / non alpha chars.
GreyHead 17 Mar, 2014
Hi, Dennis.

It does say "No spaces or special characters." under the Field Name input - but you are right, there is no further check.

Bob
wibadd 13 Feb, 2015
I am receiving the same error and I checked all my fields - the only "/" is in the label and not the field name. Why would it be giving that error?
wibadd 13 Feb, 2015
It appears it only catches this on drop down fields in CFv5, because Ii have "/" in labels on text fields and it's not causing any problems. As soon as I removed "/" on the drop down field label, the error disappeared.
Max_admin 14 Feb, 2015
Hi wibadd,

What are your Joomla/Chronoforms/PHP versions ? I have just tried this here and no errors, what's your label text exactly and where does the error appear ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.