no transfer of null to parameter of type string
- Fixes: Passing null to parameter #1 ($string) of type string is deprecated
This commit is contained in:
parent
48c2759d8a
commit
db719245af
@ -28,16 +28,15 @@
|
|||||||
/**
|
/**
|
||||||
* test if a value is a valid e-mail address
|
* test if a value is a valid e-mail address
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value the value being tested
|
||||||
* the value being tested
|
* @param boolean $empty if field can be empty
|
||||||
* @param boolean $empty
|
* @param array params validate parameter values
|
||||||
* if field can be empty
|
* @param array formvars form var values
|
||||||
* @param
|
|
||||||
* array params validate parameter values
|
|
||||||
* @param
|
|
||||||
* array formvars form var values
|
|
||||||
*/
|
*/
|
||||||
function smarty_validate_criteria_isEmail($value, $empty, &$params, &$formvars) {
|
function smarty_validate_criteria_isEmail($value, $empty, &$params, &$formvars) {
|
||||||
|
if (empty($value))
|
||||||
|
return $empty;
|
||||||
|
|
||||||
if (strlen($value) == 0)
|
if (strlen($value) == 0)
|
||||||
return $empty;
|
return $empty;
|
||||||
|
|
||||||
|
@ -35,11 +35,14 @@
|
|||||||
* @param array formvars form var values
|
* @param array formvars form var values
|
||||||
*/
|
*/
|
||||||
function smarty_validate_criteria_isURL($value, $empty, &$params, &$formvars) {
|
function smarty_validate_criteria_isURL($value, $empty, &$params, &$formvars) {
|
||||||
if(strlen($value) == 0)
|
if (empty($value))
|
||||||
return $empty;
|
return $empty;
|
||||||
|
|
||||||
return preg_match('!^http(s)?://[\w-]+\.[\w-]+(\S+)?$!i', $value)
|
if(strlen($value) == 0)
|
||||||
|| preg_match('!^http(s)?://localhost!', $value);
|
return $empty;
|
||||||
|
|
||||||
|
return preg_match('!^http(s)?://[\w-]+\.[\w-]+(\S+)?$!i', $value)
|
||||||
|
|| preg_match('!^http(s)?://localhost!', $value);
|
||||||
// quick and dirty hack: review --NoWhereMan
|
// quick and dirty hack: review --NoWhereMan
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user