Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
b1ba2439
Commit
b1ba2439
authored
May 23, 2014
by
Alexander Kochetov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP] Additional RangeValidator fixes
parent
431d8864
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
yii.validation.js
framework/assets/yii.validation.js
+12
-3
RangeValidator.php
framework/validators/RangeValidator.php
+1
-1
No files found.
framework/assets/yii.validation.js
View file @
b1ba2439
...
@@ -91,10 +91,19 @@ yii.validation = (function ($) {
...
@@ -91,10 +91,19 @@ yii.validation = (function ($) {
if
(
options
.
skipOnEmpty
&&
pub
.
isEmpty
(
value
))
{
if
(
options
.
skipOnEmpty
&&
pub
.
isEmpty
(
value
))
{
return
;
return
;
}
}
var
valid
=
!
options
.
not
&&
$
.
inArray
(
value
,
options
.
range
)
>
-
1
||
options
.
not
&&
$
.
inArray
(
value
,
options
.
range
)
==
-
1
;
if
(
!
valid
)
{
var
inArray
=
true
;
$
.
each
(
value
,
function
(
i
,
v
)
{
if
(
$
.
inArray
(
v
,
options
.
range
)
==
-
1
)
{
inArray
=
false
;
return
false
;
}
else
{
return
true
;
}
});
if
(
options
.
not
!==
inArray
)
{
pub
.
addMessage
(
messages
,
options
.
message
,
value
);
pub
.
addMessage
(
messages
,
options
.
message
,
value
);
}
}
},
},
...
...
framework/validators/RangeValidator.php
View file @
b1ba2439
...
@@ -72,7 +72,7 @@ class RangeValidator extends Validator
...
@@ -72,7 +72,7 @@ class RangeValidator extends Validator
}
}
}
}
return
(
$this
->
not
xor
$in
)
?
null
:
[
$this
->
message
,
[]];
return
$this
->
not
!==
$in
?
null
:
[
$this
->
message
,
[]];
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment