[buddypress-trac] [BuddyPress Trac] #5501: Custom xprofile field: URL

buddypress-trac noreply at wordpress.org
Fri Apr 18 17:51:13 UTC 2014

#5501: Custom xprofile field: URL
 Reporter:  sooskriszta  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.1
Component:  XProfile     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |

Comment (by boonebgorges):

 Awesome start. Thanks williamsba1!

 5501.02.patch adds some unit tests that raise a couple questions related
 to validation and workflow.

 1. 'http://foo.com/?bar=baz' was not validating with your regex, because
 it was missing `?` and `=` in the character whitelist. I added them. But
 there are probably other special characters that should be included that
 are not matched by [\/\w \.-\?\=]. `%`, `'`, etc. williamsba1 - I'm
 assuming you lifted this regex from somewhere (though I'd be pleased if
 you told me you wrote it yourself :) ) - maybe we can find one that's a
 bit more generous and faithful to the URL spec.
 2. I didn't write any tests for it, but it's likely that this is going to
 fail with non-Latin characters in URLs. Again, a more generous template
 regex is probably going to help.
 3. 'foo.com' is being validated (`(https?:\/\/)?`). If the ultimate goal
 is to display this as a link in the profile, then this can't happen.
 Ideally, we'd be able to detect this sort of thing, and then throw on an
 'http://' when the field is saved. Want to have a crack at this?

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5501#comment:9>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list