CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Add Contact choking on URL with hyphen
Pages: [1]

Author Topic: Add Contact choking on URL with hyphen  (Read 1506 times)

tomdeneckere

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.0.2
  • CMS version: Drupal 7.01
  • MySQL version: 5.0.81
  • PHP version: 5.2.9
Add Contact choking on URL with hyphen
June 25, 2011, 11:39:32 pm
Hi all,

I'm a CiviCRM newbie and a php illiterate.

The very first contact I wanted to manually add to CiviCRM caused a problem: when I filled out the URL of its website, I got an error message:
Please correct the following errors in the form fields below:
Enter a valid web location beginning with 'http://' or 'https://'.


It took me some time to find out what's going on. First I thought it had something to do with the http:// being inserted automatically, since there where a few posts in this board about that. Then I found this post in another board: http://forum.civicrm.org/index.php/topic,19865.msg82898.html#msg82898

Sure enough: coincidentally my first url contained a hyphen and, sure enough, when I tried it with a URL not containing a hyphen, it worked all right.

I have php version 5.2.9 and cannot change it, since I'm on a hosted server. Any suggestions for a patch or a workaround?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Add Contact choking on URL with hyphen
June 26, 2011, 04:21:32 pm

Your options are:

1. Eliminate the places where we invoke the 'url' rule via the buildForm hook (might be a bit cumbersome to do so)

2. Fix the code here: CRM/Utils/Rule.php (function url). You will need PHP skills here

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Add Contact choking on URL with hyphen

This forum was archived on 2017-11-26.