Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Kulya
OpnSense
Commits
1aedcd49
Commit
1aedcd49
authored
Feb 03, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(mvc) move default validator into base type
parent
9910a79f
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
166 additions
and
170 deletions
+166
-170
AuthenticationServerField.php
...ls/OPNsense/Base/FieldTypes/AuthenticationServerField.php
+13
-15
AutoNumberField.php
...c/app/models/OPNsense/Base/FieldTypes/AutoNumberField.php
+10
-13
BaseField.php
...nse/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php
+20
-1
BooleanField.php
.../mvc/app/models/OPNsense/Base/FieldTypes/BooleanField.php
+9
-10
CSVListField.php
.../mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php
+10
-9
CertificateField.php
.../app/models/OPNsense/Base/FieldTypes/CertificateField.php
+10
-10
ConfigdActionsField.php
...p/models/OPNsense/Base/FieldTypes/ConfigdActionsField.php
+10
-13
EmailField.php
...se/mvc/app/models/OPNsense/Base/FieldTypes/EmailField.php
+9
-10
IntegerField.php
.../mvc/app/models/OPNsense/Base/FieldTypes/IntegerField.php
+11
-15
InterfaceField.php
...vc/app/models/OPNsense/Base/FieldTypes/InterfaceField.php
+13
-16
ModelRelationField.php
...pp/models/OPNsense/Base/FieldTypes/ModelRelationField.php
+10
-13
NetworkField.php
.../mvc/app/models/OPNsense/Base/FieldTypes/NetworkField.php
+10
-15
OptionField.php
...e/mvc/app/models/OPNsense/Base/FieldTypes/OptionField.php
+11
-10
TextField.php
...nse/mvc/app/models/OPNsense/Base/FieldTypes/TextField.php
+11
-10
UrlField.php
...ense/mvc/app/models/OPNsense/Base/FieldTypes/UrlField.php
+9
-10
No files found.
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/AuthenticationServerField.php
View file @
1aedcd49
...
...
@@ -67,6 +67,11 @@ class AuthenticationServerField extends BaseField
*/
private
$internalMultiSelect
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"please specify a valid authentication server"
;
/**
* generate validation data (list of AuthServers)
*/
...
...
@@ -158,26 +163,19 @@ class AuthenticationServerField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"please specify a valid authentication server"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
if
(
$this
->
internalMultiSelect
)
{
// field may contain more than one authentication server
return
array
(
new
CsvListValidator
(
array
(
'message'
=>
$msg
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])))
)
;
$validators
[]
=
new
CsvListValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])));
}
else
{
// single authentication server selection
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$msg
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])))
)
;
$validators
[]
=
new
InclusionIn
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])));
}
}
else
{
// empty field and not required, skip this validation.
return
array
();
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/AutoNumberField.php
View file @
1aedcd49
...
...
@@ -43,6 +43,11 @@ class AutoNumberField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"invalid integer value"
;
/**
* maximum value for this field
* @var integer
...
...
@@ -122,23 +127,15 @@ class AutoNumberField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"invalid integer value"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
$validators
=
parent
::
getValidators
();
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
$result
=
array
();
$result
[]
=
new
MinMaxValidator
(
array
(
'message'
=>
$msg
,
if
(
$this
->
internalValue
!=
null
)
{
$validators
[]
=
new
MinMaxValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
"min"
=>
$this
->
minimum_value
,
"max"
=>
$this
->
maximum_value
));
$result
[]
=
new
IntegerValidator
(
array
(
'message'
=>
$msg
));
return
$result
;
}
else
{
// empty field and not required, skip this validation.
return
array
();
$validators
[]
=
new
IntegerValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php
View file @
1aedcd49
...
...
@@ -30,6 +30,8 @@
namespace
OPNsense\Base\FieldTypes
;
use
Phalcon\Validation\Validator\PresenceOf
;
/**
* Class BaseField
* @package OPNsense\Base\FieldTypes
...
...
@@ -323,13 +325,30 @@ abstract class BaseField
return
$this
->
internalChildnodes
;
}
/**
* check if this field is unused and required
* @return bool
*/
protected
function
isEmptyAndRequired
()
{
if
(
$this
->
internalIsRequired
&&
(
$this
->
internalValue
==
""
||
$this
->
internalValue
==
null
))
{
return
true
;
}
else
{
return
false
;
}
}
/**
* return field validators for this field
* @return array returns validators for this field type (empty if none)
*/
public
function
getValidators
()
{
return
array
();
$validators
=
array
();
if
(
$this
->
isEmptyAndRequired
())
{
$validators
[]
=
new
PresenceOf
(
array
(
'message'
=>
$this
->
internalValidationMessage
))
;
}
return
$validators
;
}
/**
...
...
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BooleanField.php
View file @
1aedcd49
...
...
@@ -41,6 +41,10 @@ class BooleanField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"value should be a boolean (0,1)"
;
/**
* retrieve field validators for this field type
...
...
@@ -51,16 +55,11 @@ class BooleanField extends BaseField
// regexp for validating boolean values.
$regex_mask
=
"/^([0,1])
{
1
}
$/"
;
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"value should be a boolean (0,1)"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
(
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
)
{
return
array
(
new
Regex
(
array
(
'message'
=>
$msg
,
'pattern'
=>
trim
(
$regex_mask
))));
}
else
{
// empty field and not required, skip this validation.
return
array
();
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
$validators
[]
=
new
Regex
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'pattern'
=>
trim
(
$regex_mask
)));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CSVListField.php
View file @
1aedcd49
...
...
@@ -42,6 +42,11 @@ class CSVListField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"list validation error"
;
/**
* item separator
* @var string
...
...
@@ -126,15 +131,11 @@ class CSVListField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"list validation error"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
||
$this
->
internalValue
!=
null
)
&&
$this
->
internalMask
!=
null
)
{
return
array
(
new
Regex
(
array
(
'message'
=>
$msg
,
'pattern'
=>
trim
(
$this
->
internalMask
))));
}
else
{
return
array
();
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
&&
$this
->
internalMask
!=
null
)
{
$validators
[]
=
new
Regex
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'pattern'
=>
trim
(
$this
->
internalMask
)));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CertificateField.php
View file @
1aedcd49
...
...
@@ -49,6 +49,11 @@ class CertificateField extends BaseField
*/
private
$certificateType
=
"cert"
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"option not in list"
;
/**
* @var array collected options
*/
...
...
@@ -110,16 +115,11 @@ class CertificateField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"option not in list"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$msg
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
))));
}
else
{
// empty field and not required, skip this validation.
return
array
();
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
$validators
[]
=
new
InclusionIn
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
)));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/ConfigdActionsField.php
View file @
1aedcd49
...
...
@@ -48,6 +48,11 @@ class ConfigdActionsField extends BaseField
*/
private
static
$internalOptionList
=
array
();
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"please specify a valid action"
;
/**
* @var array filters to use on the configd selection
*/
...
...
@@ -151,19 +156,11 @@ class ConfigdActionsField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"please specify a valid action"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$msg
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
]))));
}
else
{
// empty field and not required, skip this validation.
return
array
();
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
$validators
[]
=
new
InclusionIn
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/EmailField.php
View file @
1aedcd49
...
...
@@ -42,22 +42,21 @@ class EmailField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"email address invalid"
;
/**
* retrieve field validators for this field type
* @return array returns Email validator
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"email address invalid"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
(
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
)
{
return
array
(
new
Email
(
array
(
'message'
=>
$msg
)));
}
else
{
// empty field and not required, skip this validation.
return
array
();
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
$validators
[]
=
new
Email
(
array
(
'message'
=>
$this
->
internalValidationMessage
));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/IntegerField.php
View file @
1aedcd49
...
...
@@ -42,6 +42,11 @@ class IntegerField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"invalid integer value"
;
/**
* maximum value for this field
* @var integer
...
...
@@ -94,23 +99,14 @@ class IntegerField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"invalid integer value"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
$result
=
array
();
$result
[]
=
new
MinMaxValidator
(
array
(
'message'
=>
$msg
,
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
$result
[]
=
new
MinMaxValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
"min"
=>
$this
->
minimum_value
,
"max"
=>
$this
->
maximum_value
));
$result
[]
=
new
IntegerValidator
(
array
(
'message'
=>
$msg
));
return
$result
;
}
else
{
// empty field and not required, skip this validation.
return
array
();
));
$result
[]
=
new
IntegerValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/InterfaceField.php
View file @
1aedcd49
...
...
@@ -45,6 +45,11 @@ class InterfaceField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"please specify a valid interface"
;
/**
* @var array collected options
*/
...
...
@@ -160,30 +165,22 @@ class InterfaceField extends BaseField
/**
* retrieve field validators for this field type
* @return array returns
Text/regex validator
* @return array returns
validators
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"please specify a valid interface"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
if
(
$this
->
internalMultiSelect
)
{
// field may contain more than one interface
return
array
(
new
CsvListValidator
(
array
(
'message'
=>
$msg
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])))
)
;
$validators
[]
=
new
CsvListValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])));
}
else
{
// single interface selection
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$msg
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])))
)
;
$validators
[]
=
new
InclusionIn
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])));
}
}
else
{
// empty field and not required, skip this validation.
return
array
();
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/ModelRelationField.php
View file @
1aedcd49
...
...
@@ -42,6 +42,11 @@ class ModelRelationField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"option not in list"
;
/**
* @var array collected options
*/
...
...
@@ -135,25 +140,17 @@ class ModelRelationField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"option not in list"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
)
)
{
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
if
(
array_key_exists
(
$this
->
internalCacheKey
,
self
::
$internalOptionList
)
&&
count
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])
>
0
)
{
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$
msg
,
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$
this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
]))));
}
else
{
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$
msg
,
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$
this
->
internalValidationMessage
,
'domain'
=>
array
())));
}
}
else
{
// empty field and not required, skip this validation.
return
array
();
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/NetworkField.php
View file @
1aedcd49
...
...
@@ -42,6 +42,11 @@ class NetworkField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"please specify a valid network segment or address (IPv4/IPv6) "
;
/**
* always lowercase / trim networks
* @param string $value
...
...
@@ -57,23 +62,13 @@ class NetworkField extends BaseField
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"please specify a valid network segment or address (IPv4/IPv6) "
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
if
(
$this
->
internalValue
==
"any"
)
{
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
if
(
$this
->
internalValue
!=
"any"
)
{
// accept any as target
return
array
();
}
else
{
return
array
(
new
NetworkValidator
(
array
(
'message'
=>
$msg
)));
$validators
[]
=
new
NetworkValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
));
}
}
else
{
// empty field and not required, skip this validation.
return
array
();
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/OptionField.php
View file @
1aedcd49
...
...
@@ -42,6 +42,11 @@ class OptionField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"option not in list"
;
/**
* @var array valid options for this list
*/
...
...
@@ -92,22 +97,18 @@ class OptionField extends BaseField
return
$result
;
}
/**
* retrieve field validators for this field type
* @return array returns InclusionIn validator
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"option not in list"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
((
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
))
{
return
array
(
new
InclusionIn
(
array
(
'message'
=>
$msg
,
'domain'
=>
array_keys
(
$this
->
internalOptionList
))));
}
else
{
// empty field and not required, skip this validation.
return
array
();
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
$validators
[]
=
new
InclusionIn
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
$this
->
internalOptionList
)));
}
return
$validators
;
}
}
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/TextField.php
View file @
1aedcd49
...
...
@@ -42,6 +42,11 @@ class TextField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"text validation error"
;
/**
* @var null|string validation mask (regex)
*/
...
...
@@ -62,16 +67,12 @@ class TextField extends BaseField
*/
public
function
getValidators
()
{
$validators
=
array
();
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"text validation error"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
(
$this
->
internalIsRequired
&&
empty
(
$this
->
internalValue
))
{
$validators
[]
=
new
PresenceOf
(
array
(
'message'
=>
$msg
))
;
}
elseif
(
$this
->
internalValue
!=
null
&&
$this
->
internalMask
!=
null
)
{
$validators
[]
=
new
Regex
(
array
(
'message'
=>
$msg
,
'pattern'
=>
trim
(
$this
->
internalMask
)));
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
if
(
$this
->
internalValue
!=
null
&&
$this
->
internalMask
!=
null
)
{
$validators
[]
=
new
Regex
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'pattern'
=>
trim
(
$this
->
internalMask
)));
}
}
return
$validators
;
}
...
...
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/UrlField.php
View file @
1aedcd49
...
...
@@ -42,22 +42,21 @@ class UrlField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string default validation message string
*/
protected
$internalValidationMessage
=
"invalid url"
;
/**
* retrieve field validators for this field type
* @return array returns Url validator
*/
public
function
getValidators
()
{
if
(
$this
->
internalValidationMessage
==
null
)
{
$msg
=
"invalid url"
;
}
else
{
$msg
=
$this
->
internalValidationMessage
;
}
if
(
$this
->
internalIsRequired
==
true
||
$this
->
internalValue
!=
null
)
{
return
array
(
new
UrlValidator
(
array
(
'message'
=>
$msg
)));
}
else
{
// empty field and not required, skip this validation.
return
array
();
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
$validators
[]
=
new
UrlValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
));
}
return
$validators
;
}
}
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