From 8b419d2dd8b0e2fa4bfa1c3e549aeba5a31c80c1 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 27 Aug 2009 22:54:57 -0400 Subject: [PATCH] Removing use of ife() from core classes. --- cake/libs/validation.php | 2 +- cake/libs/view/helpers/javascript.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index be0d20c2a88..6531d97d924 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -806,7 +806,7 @@ function url($check, $strict = false) { $_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 21eab7f4487..aa8d7577f8b 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -678,7 +678,7 @@ function value($val, $quoteStrings = true) { $val = 'null'; break; case (is_bool($val)): - $val = ife($val, 'true', 'false'); + $val = !empty($val) ? 'true' : 'false'; break; case (is_int($val)): $val = $val;