From 64f993db6f70554d5dd0e3fe2db672abc4e971de Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 20 Dec 2008 07:38:46 +0000 Subject: Update modified to Kohana r3823 (svn merge -c19322 vendor/kohana/modified/kohana trunk/kohana) --- kohana/helpers/form.php | 10 ++++++---- kohana/helpers/valid.php | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'kohana/helpers') diff --git a/kohana/helpers/form.php b/kohana/helpers/form.php index 5162a1ad..bd656604 100644 --- a/kohana/helpers/form.php +++ b/kohana/helpers/form.php @@ -144,9 +144,10 @@ class form_Core { * @param string|array input name or an array of HTML attributes * @param string input value, when using a name * @param string a string to be attached to the end of the attributes + * @param boolean encode existing entities * @return string */ - public static function input($data, $value = '', $extra = '') + public static function input($data, $value = '', $extra = '', $double_encode = TRUE ) { if ( ! is_array($data)) { @@ -161,7 +162,7 @@ class form_Core { ); // For safe form data - $data['value'] = html::specialchars($data['value']); + $data['value'] = html::specialchars($data['value'], $double_encode); return ''; } @@ -212,9 +213,10 @@ class form_Core { * @param string|array input name or an array of HTML attributes * @param string input value, when using a name * @param string a string to be attached to the end of the attributes + * @param boolean encode existing entities * @return string */ - public static function textarea($data, $value = '', $extra = '') + public static function textarea($data, $value = '', $extra = '', $double_encode = TRUE ) { if ( ! is_array($data)) { @@ -227,7 +229,7 @@ class form_Core { // Value is not part of the attributes unset($data['value']); - return ''.html::specialchars($value).''; + return ''.html::specialchars($value, $double_encode).''; } /** diff --git a/kohana/helpers/valid.php b/kohana/helpers/valid.php index 3d3206c8..c2cefb5d 100644 --- a/kohana/helpers/valid.php +++ b/kohana/helpers/valid.php @@ -85,9 +85,10 @@ class valid_Core { * * @param string IP address * @param boolean allow IPv6 addresses + * @param boolean allow private IP networks * @return boolean */ - public static function ip($ip, $ipv6 = FALSE, $allow_private = FALSE) + public static function ip($ip, $ipv6 = FALSE, $allow_private = TRUE) { // By default do not allow private and reserved range IPs $flags = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE; -- cgit v1.2.3