Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.2

Bug #11140 validateParam throws error
Submitted: 2007-05-25 12:05 UTC
From: till Assigned: till
Status: Closed Package: Contact_Vcard_Build (version 1.1.1)
PHP Version: 5.2.1 OS: n/a
Roadmaps: 1.1.2    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 49 - 47 = ?

 
 [2007-05-25 12:05 UTC] till (Till Klampaeckel)
Description: ------------ validateParam expects all values to only contain a-z, 0-9 and dash, which is a huge problem if you add an email address (e.g. foo@bar.com) or a phone number (e.g. +49-170-xxx) Any email (should) contain @ and at least a single dot. Phone numbers can really contain "+" (in the country code). By the way, spaces should be allowed as well (e.g. in a street name). Also, since vcard really is an open format, I am not sure how much sense it makes to "validate" input at all. If appropriate I'd propose to validate in the designated methods - e.g. addTelephone(), addEmail(), addAddress(). Last but not least, another problem is that the error returned is really not returned/thrown outside the class. Instead it is saved in place of the proposed field/value. I am creating a patch for all this now which I will share later today.

Comments

 [2007-05-25 21:25 UTC] till (Till Klampaeckel)
Added the patch. Point taken it's a quickfix, but it does the job. Feedback?
 [2007-10-31 18:04 UTC] till (Till Klampaeckel)
Fixed in CVS. Will roll a new release soon.