Page MenuHomePhabricator

Better validation for Type:URL and Type:Email
Closed, ResolvedPublic

Description

Author: info

Description:
patch from Asheesh Laroia

On [SMW-devel] [PATCH] SMW rejects .info as email address, Asheesh Laroia comments :

Right now, includes/SMW_DV_URI.php has, in its regex for case SMW_URI_MODE_EMAIL , a check that only allows domains of length between 2 and 3 (inclusive).

This breaks .info addresses.

User's patch still won't allow new e-mail addresses in new .travel, and .museum domains, see http://en.wikipedia.org/wiki/Generic_top-level_domain

There's a long discussion of e-mail validation at
http://www.regular-expressions.info/email.html ,
SMW_DV_URI.php should probably copy one of those regexps and use it with a comment referring to the discussion.


Version: unspecified
Severity: minor
URL: http://sandbox.semantic-mediawiki.org/wiki/SMW_unit_test:Test_URLs

Attached:

Details

Reference
bz13884

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:14 PM
bzimport set Reference to bz13884.

OK, I modified the code as suggested and extended the possible characters to up to 6 (this includes museum). Better regexps should be used at some latter stage (also for URLs), and I modify this bug report accordingly.

sumanah wrote:

(In reply to comment #1)

OK, I modified the code as suggested and extended the possible characters to up
to 6 (this includes museum).

Am therefore marking patch as reviewed.

This appears to have been resolved as FIXED. I changed the status accordingly. Please reopen if that is incorrect.

sumanah wrote:

badon -- if the problem has been fixed and you know what revision number it has been fixed in, you should link to it with r#### in a comment here on Bugzilla. If you simply believe the problem is fixed because you can no longer reproduce the issue, please instead resolve as WORKSFORME.

Will do, thanks for the advice.