Bad characters in name entry field AND problems in Safari
-
- Phoca Newbie
- Posts: 7
- Joined: 18 Apr 2010, 20:56
Bad characters in name entry field AND problems in Safari
Is it possible to get the name entry field to accept hyphens? At the moment it won't accept double-barrelled names.
If this is not possible I would like to edit the en-GB.com_phocaguestbook.ini file so that the error message "The name you have entered contains bad characters" is more specific and says "Sorry, we cannot accept hyphens in your name". Otherwise the guest doesn't know what he has done wrong. However, when I change the permissions of the file, it still will not allow me to edit the file. I have tried downloading and editing in notepad but when you save the file it does keep the right configuration format. Any idea how I can edit this file if I am not able to get the field to accept the hyphens?
ALSO I have a problem running Guestbook in Safari. The main screen drops to allow an error code in the background at the top of the screen, reading:
', 'moduletable-hilite2', 'module-hilite3', 'moduletable-hilite3', 'module-hilite4', 'moduletable-hilite4', 'module-hilite5', 'moduletable-hilite5', 'module-hilite6', 'moduletable-hilite6', 'module-hilite7', 'moduletable-hilite7', 'module-hilite8', 'moduletable-hilite8', 'module-hilite9', 'moduletable-hilite9', 'module-clean', 'moduletable-clean', 'submenu-block', 'moduletable_menu']; var header = "h3"; RokBuildSpans(modules, header); });
---some of the code from a CSS file which I haven't managed to find yet! Any ideas what is causing this? It only happens in Safari.
If this is not possible I would like to edit the en-GB.com_phocaguestbook.ini file so that the error message "The name you have entered contains bad characters" is more specific and says "Sorry, we cannot accept hyphens in your name". Otherwise the guest doesn't know what he has done wrong. However, when I change the permissions of the file, it still will not allow me to edit the file. I have tried downloading and editing in notepad but when you save the file it does keep the right configuration format. Any idea how I can edit this file if I am not able to get the field to accept the hyphens?
ALSO I have a problem running Guestbook in Safari. The main screen drops to allow an error code in the background at the top of the screen, reading:
', 'moduletable-hilite2', 'module-hilite3', 'moduletable-hilite3', 'module-hilite4', 'moduletable-hilite4', 'module-hilite5', 'moduletable-hilite5', 'module-hilite6', 'moduletable-hilite6', 'module-hilite7', 'moduletable-hilite7', 'module-hilite8', 'moduletable-hilite8', 'module-hilite9', 'moduletable-hilite9', 'module-clean', 'moduletable-clean', 'submenu-block', 'moduletable_menu']; var header = "h3"; RokBuildSpans(modules, header); });
---some of the code from a CSS file which I haven't managed to find yet! Any ideas what is causing this? It only happens in Safari.
- Jan
- Phoca Hero
- Posts: 48739
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Bad characters in name entry field AND problems in Safar
Hi, the css you added here, is not from Phoca Guestbook,
try to search extensions which can include this: "... RokBuildSpans ..." as this is displayed in code
try to search extensions which can include this: "... RokBuildSpans ..." as this is displayed in code

If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 12
- Joined: 10 Oct 2009, 18:39
- Location: Canada
- Contact:
Re: Bad characters in name entry field AND problems in Safar
You can edit com_phocaguestbook/controllers/phocoguestbook.phpjennyjeffreys wrote:Is it possible to get the name entry field to accept hyphens? At the moment it won't accept double-barrelled names.
Find this line:
Code: Select all
if ($username != 0 && eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", $post['username']))
Code: Select all
if ($username != 0 && eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+]", $post['username']))
-
- Phoca Newbie
- Posts: 7
- Joined: 18 Apr 2010, 20:56
Re: Bad characters in name entry field AND problems in Safar
Thanks, that worked great! Not sure where the left and right brackets are that you refer to, but I removed the last three characters including the hyphen and it worked perfectly.
We have a lot of people with double-barrelled names here so they can now fill in the guestbook with no problems.
We have a lot of people with double-barrelled names here so they can now fill in the guestbook with no problems.
-
- Phoca Newbie
- Posts: 1
- Joined: 24 Feb 2011, 07:01
Re: Bad characters in name and title field
I've had a user complain of getting this error (The name you have entered contains bad characters) when trying to post an entry in the Guestbook. I repeated the problem and narrowed this case down to an undesired apostrophe in the word Can't.
I attempted to implement the fix in this post and couldn't because
com_phocaguestbook/controllers/phocoguestbook.php
no longer contains the lines of code mentioned below.
Any ideas?
I attempted to implement the fix in this post and couldn't because
com_phocaguestbook/controllers/phocoguestbook.php
no longer contains the lines of code mentioned below.
Any ideas?
Klementz wrote:You can edit com_phocaguestbook/controllers/phocoguestbook.phpjennyjeffreys wrote:Is it possible to get the name entry field to accept hyphens? At the moment it won't accept double-barrelled names.
Find this line:and change it to this:Code: Select all
if ($username != 0 && eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", $post['username']))
You need to remove the pipe character |, the escape character \, and the symbol you don't want checked for. I also took out the left and right brackets. Note that this line of code appears twice within a dozen lines of each other. I changed them both, and it works fine.Code: Select all
if ($username != 0 && eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+]", $post['username']))
- Jan
- Phoca Hero
- Posts: 48739
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Bad characters in name entry field AND problems in Safar
Hi, this ' is removed because of possible security problems, usernames cannot include this characters: '
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 7
- Joined: 18 Apr 2010, 20:56
Re: Bad characters in name entry field AND problems in Safar
What are the security problems you mention? Does it make you more susceptible to spam entries?
We get a lot of unwanted registrations in the guestbook which we have tried to block using the Captcha options, but these do not seem to work.
We tried making it only possible for registered users to sign the guestbook but this takes longer and deters people from signing up.
So now we get them to use a simple contact form and we post them ourselves.
This is a great component - it's just a shame we can't block all the spam entries.
We get a lot of unwanted registrations in the guestbook which we have tried to block using the Captcha options, but these do not seem to work.
We tried making it only possible for registered users to sign the guestbook but this takes longer and deters people from signing up.
So now we get them to use a simple contact form and we post them ourselves.
This is a great component - it's just a shame we can't block all the spam entries.
-
- Phoca Member
- Posts: 19
- Joined: 15 Sep 2010, 19:58
Re: Bad characters in name entry field AND problems in Safar
Just installed version 1.4.4. and received the message "The name you have entered contains bad characters" when entering a title with an apostrophe in it.
After some searching, I found the following code in /controllers/phocaguestbook.php:
After changing it to
the error no longer appeared.
It looks like the title was used as input for checking the username!
Hope this helps.
Marga
After some searching, I found the following code in /controllers/phocaguestbook.php:
Code: Select all
if ($username != 0 && preg_match("~[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+]~",$post2['title'])) {
Code: Select all
if ($username != 0 && preg_match("~[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+]~",$post2['username'])) {
It looks like the title was used as input for checking the username!
Hope this helps.
Marga
- Jan
- Phoca Hero
- Posts: 48739
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Bad characters in name entry field AND problems in Safar
Hi, thank you for the info.
Jan
Jan
If you find Phoca extensions useful, please support the project