From 9f04fef3e046d7b4778ddf449589c9b1a3a67857 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 30 Mar 2009 18:09:17 +0000 Subject: Updated to r807 --- kohana/helpers/feed.php | 4 ++++ kohana/helpers/html.php | 16 ++++++++++++++-- kohana/helpers/valid.php | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'kohana/helpers') diff --git a/kohana/helpers/feed.php b/kohana/helpers/feed.php index 53b1fd15..c1e0b81f 100644 --- a/kohana/helpers/feed.php +++ b/kohana/helpers/feed.php @@ -20,6 +20,10 @@ class feed_Core { */ public static function parse($feed, $limit = 0) { + // Check if SimpleXML is installed + if( ! function_exists('simplexml_load_file')) + throw new Kohana_User_Exception('Feed Error', 'SimpleXML must be installed!'); + // Make limit an integer $limit = (int) $limit; diff --git a/kohana/helpers/html.php b/kohana/helpers/html.php index daf16a04..375baf38 100644 --- a/kohana/helpers/html.php +++ b/kohana/helpers/html.php @@ -49,6 +49,18 @@ class html_Core { return $str; } + /** + * Perform a html::specialchars() with additional URL specific encoding. + * + * @param string string to convert + * @param boolean encode existing entities + * @return string + */ + public static function specialurlencode($str, $double_encode = TRUE) + { + return str_replace(' ', '%20', html::specialchars($str, $double_encode)); + } + /** * Create HTML link anchors. * @@ -80,7 +92,7 @@ class html_Core { return // Parsed URL - '' // Title empty? Use the parsed URL @@ -100,7 +112,7 @@ class html_Core { { return // Base URL + URI = full URL - '' // Title empty? Use the filename part of the URI diff --git a/kohana/helpers/valid.php b/kohana/helpers/valid.php index 916a0c19..88cca584 100644 --- a/kohana/helpers/valid.php +++ b/kohana/helpers/valid.php @@ -277,7 +277,7 @@ class valid_Core { { // Use localeconv to set the decimal_point value: Usually a comma or period. $locale = localeconv(); - return (preg_match('/^[-0-9'.$locale['decimal_point'].']++$/D', (string) $str)); + return (preg_match('/^-?[0-9'.$locale['decimal_point'].']++$/D', (string) $str)); } /** -- cgit v1.2.3