PHP Feedback form bug?

I have a client with a ‘hyphen’ their email address. (company-dept @ company.com). They tried testing a form using their own email address. And it fails, the PHP Feedback form will not process the form.

Is this a bug? or just me.

Could someone else try putting an email in their own PHP form (with a ‘hyphen’). See if this happens to your form.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It could be an over-restrictive regular expression testing for the
quality of the e-mail address. I don’t have a copy of the Action
here, but I imagine this would be easy to fix if it’s not encoded.
Otherwise, if you e-mail Tim Plumb, I am sure he can sort this out
for you.

Walter

On Mar 3, 2008, at 9:11 AM, WebWorker wrote:

I have a client with a ‘hyphen’ their email address. (company-dept
@ company.com). They tried testing a form using their own email
address. And it fails, the PHP Feedback form will not process the
form.

Is this a bug? or just me.

Could someone else try putting an email in their own PHP form (with
a ‘hyphen’). See if this happens to your form.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Adding the ‘-’ to the PHP file (on the server) fixed the problem (temporary fix)

      		if (!preg_match('/^[a-zA-Z0-9_.]+@[a-zA-Z0-9-.]+.[a-zA-Z]+(.[a-zA-Z]+)?$/', $email)){

to

      		if (!preg_match('/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-.]+.[a-zA-Z]+(.[a-zA-Z]+)?$/', $email)){

freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try opening the Action on your computer. You can add this change to
the regular expression there and be set for life! Actions live in
[your home folder]/Library/Application Support/Freeway 4/Actions/
General/ and they can be opened with any plain-text editor.

Oh, and you should put the hyphen as the first character in the
regex, that way you don’t have to worry about it being interpreted as
part of a range. If last works for you, that’s great, but first is
the “proper” place for it according to the thick book of Regex-fu.

Walter

On Mar 3, 2008, at 9:45 AM, WebWorker wrote:

Adding the ‘-’ to the PHP file (on the server) fixed the problem
(temporary fix)

    		if (!preg_match('/^[a-zA-Z0-9_.]+@[a-zA-Z0-9-.]+.[a-zA- 

Z]+(.[a-zA-Z]+)?$/', $email)){

to

    		if (!preg_match('/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-.]+.[a-zA- 

Z]+(.[a-zA-Z]+)?$/', $email)){


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes opened the PHP (text) action and changed it there also. Thanks for the tip about ‘-’ first.

If you try and complete the contact form at: http://www.freewayactions.com/product.php?id=con and enter an email address (firstname-lastnamename @ domain.com) with hypen the form fails. I assume thats using the latest version - which is encrypted.

I think others should know in case they are missing replies to forms (if only a small percentage)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

At 09:45 -0500 3/3/08, WebWorker wrote:

Adding the ‘-’ to the PHP file (on the server) fixed the problem
(temporary fix)

    		if 

(!preg_match(‘/[1]+@[a-zA-Z0-9-.]+.[a-zA-Z]+(.[a-zA-Z]+)?$/’,
$email)){

to

    		if 

(!preg_match(‘/[2]+@[a-zA-Z0-9-.]+.[a-zA-Z]+(.[a-zA-Z]+)?$/’,
$email)){

Note that putting the extra ‘-’ immediately before the ‘]’ that
closes the group is not accidental.

A ‘-’ at either end means ‘-’ as you want. A ‘-’ in the middle can
indicate a range from the character before it to the one after, which
can really mess things up.

David


David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
email@hidden
www.ivdcs.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


  1. a-zA-Z0-9_. ↩︎

  2. a-zA-Z0-9_.- ↩︎

David

I’ve put the ‘-’ just before the ‘]’ and it seems to work.

Is that the correct place?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Aha, never assume that my web site uses the latest version of my actions! :wink:
I’m sure I added support for hyphens a while ago but checking just now it
appears this only went in the domain ‘bit’. I’ll update the action and bump the
version to reflect the change.
Thanks WebWorker.
Regards,
Tim.

Quoting WebWorker email@hidden:

Yes opened the PHP (text) action and changed it there also. Thanks for the
tip about ‘-’ first.

If you try and complete the contact form at:
http://www.freewayactions.com/product.php?id=con and enter an email address
(firstname-lastnamename @ domain.com) with hypen the form fails. I assume
thats using the latest version - which is encrypted.

I think others should know in case they are missing replies to forms (if only
a small percentage)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options