diff --git a/cake/libs/validation.php b/cake/libs/validation.php index fd2606c5f..ee8db26d4 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -844,7 +844,7 @@ class Validation extends Object { $_this =& Validation::getInstance(); $_this->check = $check; $validChars = '([' . preg_quote('!"$&\'()*+,-.@_:;=') . '\/0-9a-z]|(%[0-9a-f]{2}))'; - $_this->regex = '/^(?:(?:https?|ftps?|file|news|gopher):\/\/)' . ife($strict, '', '?') . + $_this->regex = '/^(?:(?:https?|ftps?|file|news|gopher):\/\/)' . (!empty($strict) ? '' : '?') . '(?:' . $_this->__pattern['ip'] . '|' . $_this->__pattern['hostname'] . ')(?::[1-9][0-9]{0,3})?' . '(?:\/?|\/' . $validChars . '*)?' . '(?:\?' . $validChars . '*)?' . diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index ff439571e..a018130b1 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -702,7 +702,7 @@ class JavascriptHelper extends AppHelper { $val = 'null'; break; case (is_bool($val)): - $val = ife($val, 'true', 'false'); + $val = !empty($val) ? 'true' : 'false'; break; case (is_int($val)): $val = $val;