summaryrefslogtreecommitdiff
path: root/kohana/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/helpers')
-rw-r--r--kohana/helpers/form.php10
-rw-r--r--kohana/helpers/valid.php3
2 files changed, 8 insertions, 5 deletions
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 '<input'.form::attributes($data).' '.$extra.' />';
}
@@ -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 '<textarea'.form::attributes($data, 'textarea').' '.$extra.'>'.html::specialchars($value).'</textarea>';
+ return '<textarea'.form::attributes($data, 'textarea').' '.$extra.'>'.html::specialchars($value, $double_encode).'</textarea>';
}
/**
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;