From c6d918ad24a8844e9de1e145f545bc9f2c7ca9a6 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 22 Apr 2011 10:17:32 -0500 Subject: Fix #233 Fixing a regression in _get_validation_object() in the form helper after some refactoring the other day. --- system/helpers/form_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 51a9c6ca3..16eb4b2c9 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -898,7 +898,7 @@ if ( ! function_exists('validation_errors')) function validation_errors($prefix = '', $suffix = '') { if (FALSE === ($OBJ =& _get_validation_object())) - { + {var_dump(_get_validation_object()); exit; return ''; } @@ -1035,7 +1035,7 @@ if ( ! function_exists('_get_validation_object')) // We set this as a variable since we're returning by reference. $return = FALSE; - if ( ! ($object = $CI->load->is_loaded('form_validation'))) + if (FALSE !== ($object = $CI->load->is_loaded('form_validation'))) { if ( ! isset($CI->$object) OR ! is_object($CI->$object)) { -- cgit v1.2.3-24-g4f1b From c83bea665eb3a441b6e52528f75fa4c71ca1f8c2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sat, 23 Apr 2011 12:12:57 -0500 Subject: Removing debug code accidentally committed. --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers') diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 16eb4b2c9..2925d3c7c 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -898,7 +898,7 @@ if ( ! function_exists('validation_errors')) function validation_errors($prefix = '', $suffix = '') { if (FALSE === ($OBJ =& _get_validation_object())) - {var_dump(_get_validation_object()); exit; + { return ''; } -- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- system/helpers/array_helper.php | 8 ++++---- system/helpers/captcha_helper.php | 20 ++++++++++---------- system/helpers/cookie_helper.php | 6 +++--- system/helpers/date_helper.php | 22 +++++++++++----------- system/helpers/directory_helper.php | 4 ++-- system/helpers/download_helper.php | 2 +- system/helpers/email_helper.php | 2 +- system/helpers/file_helper.php | 4 ++-- system/helpers/form_helper.php | 18 +++++++++--------- system/helpers/html_helper.php | 10 +++++----- system/helpers/inflector_helper.php | 14 +++++++------- system/helpers/language_helper.php | 2 +- system/helpers/number_helper.php | 2 +- system/helpers/path_helper.php | 4 ++-- system/helpers/security_helper.php | 4 ++-- system/helpers/smiley_helper.php | 12 ++++++------ system/helpers/string_helper.php | 8 ++++---- system/helpers/text_helper.php | 10 +++++----- system/helpers/typography_helper.php | 2 +- system/helpers/url_helper.php | 6 +++--- system/helpers/xml_helper.php | 4 ++-- 21 files changed, 82 insertions(+), 82 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index 075a31fdf..daa21a3ef 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -1,4 +1,4 @@ -text. To close fieldset + * Used to produce
text. To close fieldset * use form_fieldset_close() * * @access public @@ -663,7 +663,7 @@ if ( ! function_exists('form_prep')) * Form Value * * Grabs a value from the POST array for the specified field so you can - * re-populate an input field or textarea. If Form Validation + * re-populate an input field or textarea. If Form Validation * is active it retrieves the info from the validation class * * @access public @@ -858,7 +858,7 @@ if ( ! function_exists('set_radio')) /** * Form Error * - * Returns the error for a specific form field. This is a helper for the + * Returns the error for a specific form field. This is a helper for the * form validation class. * * @access public @@ -885,7 +885,7 @@ if ( ! function_exists('form_error')) /** * Validation Error String * - * Returns all the errors associated with a form submission. This is a helper + * Returns all the errors associated with a form submission. This is a helper * function for the form validation class. * * @access public @@ -1034,17 +1034,17 @@ if ( ! function_exists('_get_validation_object')) // We set this as a variable since we're returning by reference. $return = FALSE; - + if (FALSE !== ($object = $CI->load->is_loaded('form_validation'))) { if ( ! isset($CI->$object) OR ! is_object($CI->$object)) { return $return; } - + return $CI->$object; } - + return $return; } } diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index 080f622dd..bd66bc2d0 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -1,4 +1,4 @@ -\n"; - // Cycle through the list elements. If an array is + // Cycle through the list elements. If an array is // encountered we will recursively call _list() static $_last_list_item = ''; @@ -244,7 +244,7 @@ if ( ! function_exists('img')) * Generates a page document type declaration * * Valid options are xhtml-11, xhtml-strict, xhtml-trans, xhtml-frame, - * html4-strict, html4-trans, and html4-frame. Values are saved in the + * html4-strict, html4-trans, and html4-frame. Values are saved in the * doctypes config file. * * @access public diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index c7c113b8a..2352b642e 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -1,4 +1,4 @@ -'), array('<?php', '<?PHP', '<?', '?>'), $str); + return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); } } diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 6d8889354..22ca4df77 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -1,4 +1,4 @@ - $val) { // Keep duplicates from being used, which can happen if the - // mapping array contains multiple identical replacements. For example: + // mapping array contains multiple identical replacements. For example: // :-) and :) might be replaced with the same image so both smileys // will be in the array. if (isset($used[$smileys[$key][0]])) @@ -204,7 +204,7 @@ if ( ! function_exists('parse_smileys')) } // Add a trailing slash to the file path if needed - $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); + $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); foreach ($smileys as $key => $val) { @@ -231,13 +231,13 @@ if ( ! function_exists('_get_smiley_array')) { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); + include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); } elseif (file_exists(APPPATH.'config/smileys.php')) { include(APPPATH.'config/smileys.php'); } - + if (isset($smileys) AND is_array($smileys)) { return $smileys; diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 7765bba31..9f730bd10 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,4 +1,4 @@ - $val) { - $x[] = ' '.$key.'="'; + $x[] = ' '.$key.'="'; for ($i = 0; $i < strlen($val); $i++) { $x[] = "|".ord(substr($val, $i, 1)); @@ -363,7 +363,7 @@ if ( ! function_exists('safe_mailto')) * * Automatically links URL and Email addresses. * Note: There's a bit of extra code here to deal with - * URLs or emails that end in a period. We'll strip these + * URLs or emails that end in a period. We'll strip these * off and add them after the link. * * @access public diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php index cdd81ad70..2219d662a 100644 --- a/system/helpers/xml_helper.php +++ b/system/helpers/xml_helper.php @@ -1,4 +1,4 @@ -","\"", "'", "-"), -- cgit v1.2.3-24-g4f1b From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:40:48 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- system/helpers/array_helper.php | 8 ++++---- system/helpers/captcha_helper.php | 20 ++++++++++---------- system/helpers/cookie_helper.php | 6 +++--- system/helpers/date_helper.php | 22 +++++++++++----------- system/helpers/directory_helper.php | 4 ++-- system/helpers/download_helper.php | 2 +- system/helpers/email_helper.php | 2 +- system/helpers/file_helper.php | 4 ++-- system/helpers/form_helper.php | 18 +++++++++--------- system/helpers/html_helper.php | 10 +++++----- system/helpers/inflector_helper.php | 14 +++++++------- system/helpers/language_helper.php | 2 +- system/helpers/number_helper.php | 2 +- system/helpers/path_helper.php | 4 ++-- system/helpers/security_helper.php | 4 ++-- system/helpers/smiley_helper.php | 12 ++++++------ system/helpers/string_helper.php | 8 ++++---- system/helpers/text_helper.php | 10 +++++----- system/helpers/typography_helper.php | 2 +- system/helpers/url_helper.php | 6 +++--- system/helpers/xml_helper.php | 4 ++-- 21 files changed, 82 insertions(+), 82 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index daa21a3ef..075a31fdf 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -1,4 +1,4 @@ -text. To close fieldset + * Used to produce
text. To close fieldset * use form_fieldset_close() * * @access public @@ -663,7 +663,7 @@ if ( ! function_exists('form_prep')) * Form Value * * Grabs a value from the POST array for the specified field so you can - * re-populate an input field or textarea. If Form Validation + * re-populate an input field or textarea. If Form Validation * is active it retrieves the info from the validation class * * @access public @@ -858,7 +858,7 @@ if ( ! function_exists('set_radio')) /** * Form Error * - * Returns the error for a specific form field. This is a helper for the + * Returns the error for a specific form field. This is a helper for the * form validation class. * * @access public @@ -885,7 +885,7 @@ if ( ! function_exists('form_error')) /** * Validation Error String * - * Returns all the errors associated with a form submission. This is a helper + * Returns all the errors associated with a form submission. This is a helper * function for the form validation class. * * @access public @@ -1034,17 +1034,17 @@ if ( ! function_exists('_get_validation_object')) // We set this as a variable since we're returning by reference. $return = FALSE; - + if (FALSE !== ($object = $CI->load->is_loaded('form_validation'))) { if ( ! isset($CI->$object) OR ! is_object($CI->$object)) { return $return; } - + return $CI->$object; } - + return $return; } } diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index bd66bc2d0..080f622dd 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -1,4 +1,4 @@ -\n"; - // Cycle through the list elements. If an array is + // Cycle through the list elements. If an array is // encountered we will recursively call _list() static $_last_list_item = ''; @@ -244,7 +244,7 @@ if ( ! function_exists('img')) * Generates a page document type declaration * * Valid options are xhtml-11, xhtml-strict, xhtml-trans, xhtml-frame, - * html4-strict, html4-trans, and html4-frame. Values are saved in the + * html4-strict, html4-trans, and html4-frame. Values are saved in the * doctypes config file. * * @access public diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 2352b642e..c7c113b8a 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -1,4 +1,4 @@ -'), array('<?php', '<?PHP', '<?', '?>'), $str); + return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); } } diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 22ca4df77..6d8889354 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -1,4 +1,4 @@ - $val) { // Keep duplicates from being used, which can happen if the - // mapping array contains multiple identical replacements. For example: + // mapping array contains multiple identical replacements. For example: // :-) and :) might be replaced with the same image so both smileys // will be in the array. if (isset($used[$smileys[$key][0]])) @@ -204,7 +204,7 @@ if ( ! function_exists('parse_smileys')) } // Add a trailing slash to the file path if needed - $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); + $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); foreach ($smileys as $key => $val) { @@ -231,13 +231,13 @@ if ( ! function_exists('_get_smiley_array')) { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); + include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); } elseif (file_exists(APPPATH.'config/smileys.php')) { include(APPPATH.'config/smileys.php'); } - + if (isset($smileys) AND is_array($smileys)) { return $smileys; diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 9f730bd10..7765bba31 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,4 +1,4 @@ - $val) { - $x[] = ' '.$key.'="'; + $x[] = ' '.$key.'="'; for ($i = 0; $i < strlen($val); $i++) { $x[] = "|".ord(substr($val, $i, 1)); @@ -363,7 +363,7 @@ if ( ! function_exists('safe_mailto')) * * Automatically links URL and Email addresses. * Note: There's a bit of extra code here to deal with - * URLs or emails that end in a period. We'll strip these + * URLs or emails that end in a period. We'll strip these * off and add them after the link. * * @access public diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php index 2219d662a..cdd81ad70 100644 --- a/system/helpers/xml_helper.php +++ b/system/helpers/xml_helper.php @@ -1,4 +1,4 @@ -","\"", "'", "-"), -- cgit v1.2.3-24-g4f1b