mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Correct a regular expression for urls
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8558 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4d26d3b980
commit
402bfe6ab5
2 changed files with 2 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ class Validator
|
|||
$this->addRule(array(
|
||||
'email' => '/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/',
|
||||
'userid' => '/^[a-z]+[\w-]*[a-z0-9_]+$/i',
|
||||
'url' => '/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-]+)+(:[0-9]+)/',
|
||||
'url' => '/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-]+)+(:\d+)?/',
|
||||
'alpha' => '/^[a-z]*$/i',
|
||||
'alpha_number' => '/^[a-z][a-z0-9_]*$/i',
|
||||
'number' => '/^(?:[1-9]\\d*|0)$/'
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ var Validator = xe.createApp('Validator', {
|
|||
this.cast('ADD_RULE', ['user_id', regUserid]);
|
||||
|
||||
// url
|
||||
var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;
|
||||
var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-]+)+(:\d+)?/;
|
||||
this.cast('ADD_RULE', ['url', regUrl]);
|
||||
this.cast('ADD_RULE', ['homepage', regUrl]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue