From 9e2df7c1fc8f8f5c9837f52c308f72e9f326b577 Mon Sep 17 00:00:00 2001 From: druu Date: Tue, 6 Sep 2011 22:19:59 +0300 Subject: Major speed improvement in function random_string() for cases 'alpha', 'alnum', 'numeric' and 'nozero' --- system/helpers/string_helper.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 9fa69f46c..dd8ffaddb 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -215,12 +215,9 @@ if ( ! function_exists('random_string')) case 'nozero' : $pool = '123456789'; break; } - - $str = ''; - for ($i=0; $i < $len; $i++) - { - $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); - } + + $str = substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len); + return $str; break; case 'unique' : -- cgit v1.2.3-24-g4f1b From f4a4bd8fac188ebc9cda822ffc811c218fd92b45 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 20 Oct 2011 12:18:42 -0500 Subject: adding new license file (OSL 3.0) and updating readme to ReST added notice of license to all source files. OSL to all except the few files we ship inside of the application folder, those are AFL. Updated license in user guide. incrementing next dev version to 3.0 due to licensing change --- system/helpers/string_helper.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index dd8ffaddb..6691681e0 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/string_helper.html */ -- cgit v1.2.3-24-g4f1b From 0defe5d33ee2633f377a109519ca818becc60f64 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 1 Jan 2012 18:46:41 -0600 Subject: Updating copyright date to 2012 --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 6691681e0..04d51c2f9 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 4921fed6c17a54efd4fac0bed4d058463bd9b601 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 7 Jan 2012 01:28:07 +0200 Subject: Improve the smiley, string & text helpers --- system/helpers/string_helper.php | 81 +++++++++++++++------------------------- 1 file changed, 31 insertions(+), 50 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 04d51c2f9..654f721b0 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,13 +1,13 @@ -load->helper('security'); - - return do_hash(uniqid(mt_rand(), TRUE), 'sha1'); - break; + case 'basic': return mt_rand(); + case 'alnum': + case 'numeric': + case 'nozero': + case 'alpha': + switch ($type) + { + case 'alpha': $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + break; + case 'alnum': $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + break; + case 'numeric': $pool = '0123456789'; + break; + case 'nozero': $pool = '123456789'; + break; + } + return substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len); + case 'unique': + case 'md5': return md5(uniqid(mt_rand())); + case 'encrypt': + case 'sha1': + $CI =& get_instance(); + $CI->load->helper('security'); + return do_hash(uniqid(mt_rand(), TRUE), 'sha1'); } } } @@ -262,7 +245,6 @@ if ( ! function_exists('random_string')) function increment_string($str, $separator = '_', $first = 1) { preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); - return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first; } @@ -311,6 +293,5 @@ if ( ! function_exists('repeater')) } } - /* End of file string_helper.php */ -/* Location: ./system/helpers/string_helper.php */ \ No newline at end of file +/* Location: ./system/helpers/string_helper.php */ -- cgit v1.2.3-24-g4f1b From cb324bd9268fc6b0c93fd22545bd989771d68b04 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 8 Jan 2012 07:06:35 +0200 Subject: Some more misc. stuff --- system/helpers/string_helper.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 654f721b0..fcdb0aa84 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter String Helpers * @@ -153,7 +151,7 @@ if ( ! function_exists('reduce_double_slashes')) { function reduce_double_slashes($str) { - return preg_replace("#(^|[^:])//+#", "\\1/", $str); + return preg_replace('#(^|[^:])//+#', '\\1/', $str); } } @@ -181,7 +179,6 @@ if ( ! function_exists('reduce_multiples')) function reduce_multiples($str, $character = ',', $trim = FALSE) { $str = preg_replace('#'.preg_quote($character, '#').'{2,}#', $character, $str); - return ($trim === TRUE) ? trim($str, $character) : $str; } } @@ -211,13 +208,17 @@ if ( ! function_exists('random_string')) case 'alpha': switch ($type) { - case 'alpha': $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + case 'alpha': + $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; - case 'alnum': $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + case 'alnum': + $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; - case 'numeric': $pool = '0123456789'; + case 'numeric': + $pool = '0123456789'; break; - case 'nozero': $pool = '123456789'; + case 'nozero': + $pool = '123456789'; break; } return substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len); -- cgit v1.2.3-24-g4f1b From 09375d71aa933ac6ba3665f7ccc6949840177ade Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 19 Jan 2012 14:57:46 +0200 Subject: Some more cleaning --- system/helpers/string_helper.php | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index fcdb0aa84..d0948800b 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -9,7 +9,7 @@ * Licensed under the Open Software License version 3.0 * * This source file is subject to the Open Software License (OSL 3.0) that is - * bundled with this package in the files license.txt / license.rst. It is + * bundled with this package in the files license.txt / license.rst. It is * also available through the world wide web at this URL: * http://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to obtain it @@ -75,16 +75,14 @@ if ( ! function_exists('strip_slashes')) { function strip_slashes($str) { - if (is_array($str)) + if ( ! is_array($str)) { - foreach ($str as $key => $val) - { - $str[$key] = strip_slashes($val); - } + return stripslashes($str); } - else + + foreach ($str as $key => $val) { - return stripslashes($str); + $str[$key] = strip_slashes($val); } return $str; @@ -192,7 +190,7 @@ if ( ! function_exists('reduce_multiples')) * * @access public * @param string type of random string. basic, alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1 - * @param integer number of characters + * @param int number of characters * @return string */ if ( ! function_exists('random_string')) @@ -238,10 +236,10 @@ if ( ! function_exists('random_string')) /** * Add's _1 to a string or increment the ending number to allow _2, _3, etc * - * @param string $str required - * @param string $separator What should the duplicate number be appended with - * @param string $first Which number should be used for the first dupe increment - * @return string + * @param string $str required + * @param string $separator What should the duplicate number be appended with + * @param string $first Which number should be used for the first dupe increment + * @return string */ function increment_string($str, $separator = '_', $first = 1) { @@ -254,10 +252,10 @@ function increment_string($str, $separator = '_', $first = 1) /** * Alternator * - * Allows strings to be alternated. See docs... + * Allows strings to be alternated. See docs... * * @access public - * @param string (as many parameters as needed) + * @param string (as many parameters as needed) * @return string */ if ( ! function_exists('alternator')) @@ -283,14 +281,14 @@ if ( ! function_exists('alternator')) * * @access public * @param string - * @param integer number of repeats + * @param int number of repeats * @return string */ if ( ! function_exists('repeater')) { function repeater($data, $num = 1) { - return (($num > 0) ? str_repeat($data, $num) : ''); + return ($num > 0) ? str_repeat($data, $num) : ''; } } -- cgit v1.2.3-24-g4f1b From c5a1f93ef25c99df4035ef7182a6200b91afabab Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 24 Jan 2012 15:29:02 +0200 Subject: Revert a space in the license agreement :) --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index d0948800b..0d1018f53 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -9,7 +9,7 @@ * Licensed under the Open Software License version 3.0 * * This source file is subject to the Open Software License (OSL 3.0) that is - * bundled with this package in the files license.txt / license.rst. It is + * bundled with this package in the files license.txt / license.rst. It is * also available through the world wide web at this URL: * http://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to obtain it -- cgit v1.2.3-24-g4f1b From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 04d51c2f9..607a12bcb 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From 75124a53cf54f2a8c094756f9189be9159957f28 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 13 Mar 2012 12:47:58 +0200 Subject: Some comments altered --- system/helpers/string_helper.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 6573b9a5d..a53d1b88e 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -48,7 +48,6 @@ * * this/that/theother * - * @access public * @param string * @return string */ @@ -67,7 +66,6 @@ if ( ! function_exists('trim_slashes')) * * Removes slashes contained in a string or in an array * - * @access public * @param mixed string or array * @return mixed string or array */ @@ -96,7 +94,6 @@ if ( ! function_exists('strip_slashes')) * * Removes single and double quotes from a string * - * @access public * @param string * @return string */ @@ -115,7 +112,6 @@ if ( ! function_exists('strip_quotes')) * * Converts single and double quotes to entities * - * @access public * @param string * @return string */ @@ -141,7 +137,6 @@ if ( ! function_exists('quotes_to_entities')) * * http://www.some-site.com/index.php * - * @access public * @param string * @return string */ @@ -166,7 +161,6 @@ if ( ! function_exists('reduce_double_slashes')) * * Fred, Bill, Joe, Jimmy * - * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end @@ -188,7 +182,6 @@ if ( ! function_exists('reduce_multiples')) * * Useful for generating passwords or hashes. * - * @access public * @param string type of random string. basic, alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1 * @param int number of characters * @return string @@ -219,7 +212,7 @@ if ( ! function_exists('random_string')) $pool = '123456789'; break; } - return substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len); + return substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len); case 'unique': case 'md5': return md5(uniqid(mt_rand())); case 'encrypt': @@ -241,10 +234,13 @@ if ( ! function_exists('random_string')) * @param string $first Which number should be used for the first dupe increment * @return string */ -function increment_string($str, $separator = '_', $first = 1) +if ( ! function_exists('increment_string')) { - preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); - return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first; + function increment_string($str, $separator = '_', $first = 1) + { + preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); + return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first; + } } // ------------------------------------------------------------------------ @@ -254,7 +250,6 @@ function increment_string($str, $separator = '_', $first = 1) * * Allows strings to be alternated. See docs... * - * @access public * @param string (as many parameters as needed) * @return string */ @@ -279,7 +274,6 @@ if ( ! function_exists('alternator')) /** * Repeater function * - * @access public * @param string * @param int number of repeats * @return string -- cgit v1.2.3-24-g4f1b From e79a3b134bb5268106d550934808dd9e404ca515 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 15:41:22 +0200 Subject: Remove EOF newlines --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index a53d1b88e..e570d5d01 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -287,4 +287,4 @@ if ( ! function_exists('repeater')) } /* End of file string_helper.php */ -/* Location: ./system/helpers/string_helper.php */ +/* Location: ./system/helpers/string_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e684bdac2d6282e3b9a5c57e1006d5ed1664f647 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 26 Mar 2012 13:47:29 +0300 Subject: Clear some spaces and fix some inconsistencies in the Zip library and system/helpers/ files --- system/helpers/string_helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 607a12bcb..c61b26592 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,13 +1,13 @@ - Date: Mon, 26 Mar 2012 21:50:00 +0300 Subject: Remove access description lines and cleanup the string and typography helpers --- system/helpers/string_helper.php | 41 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index c61b26592..aed35c157 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter String Helpers * @@ -50,7 +48,6 @@ * * this/that/theother * - * @access public * @param string * @return string */ @@ -69,7 +66,6 @@ if ( ! function_exists('trim_slashes')) * * Removes slashes contained in a string or in an array * - * @access public * @param mixed string or array * @return mixed string or array */ @@ -100,7 +96,6 @@ if ( ! function_exists('strip_slashes')) * * Removes single and double quotes from a string * - * @access public * @param string * @return string */ @@ -119,7 +114,6 @@ if ( ! function_exists('strip_quotes')) * * Converts single and double quotes to entities * - * @access public * @param string * @return string */ @@ -145,7 +139,6 @@ if ( ! function_exists('quotes_to_entities')) * * http://www.some-site.com/index.php * - * @access public * @param string * @return string */ @@ -153,7 +146,7 @@ if ( ! function_exists('reduce_double_slashes')) { function reduce_double_slashes($str) { - return preg_replace("#(^|[^:])//+#", "\\1/", $str); + return preg_replace('#(^|[^:])//+#', '\\1/', $str); } } @@ -170,7 +163,6 @@ if ( ! function_exists('reduce_double_slashes')) * * Fred, Bill, Joe, Jimmy * - * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end @@ -184,7 +176,7 @@ if ( ! function_exists('reduce_multiples')) if ($trim === TRUE) { - $str = trim($str, $character); + return trim($str, $character); } return $str; @@ -198,9 +190,8 @@ if ( ! function_exists('reduce_multiples')) * * Useful for generating passwords or hashes. * - * @access public * @param string type of random string. basic, alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1 - * @param integer number of characters + * @param int number of characters * @return string */ if ( ! function_exists('random_string')) @@ -254,16 +245,19 @@ if ( ! function_exists('random_string')) /** * Add's _1 to a string or increment the ending number to allow _2, _3, etc * - * @param string $str required - * @param string $separator What should the duplicate number be appended with - * @param string $first Which number should be used for the first dupe increment - * @return string + * @param string required + * @param string What should the duplicate number be appended with + * @param string Which number should be used for the first dupe increment + * @return string */ -function increment_string($str, $separator = '_', $first = 1) +if ( ! function_exists('increment_string')) { - preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); + function increment_string($str, $separator = '_', $first = 1) + { + preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); - return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first; + return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first; + } } // ------------------------------------------------------------------------ @@ -271,9 +265,8 @@ function increment_string($str, $separator = '_', $first = 1) /** * Alternator * - * Allows strings to be alternated. See docs... + * Allows strings to be alternated. See docs... * - * @access public * @param string (as many parameters as needed) * @return string */ @@ -298,19 +291,17 @@ if ( ! function_exists('alternator')) /** * Repeater function * - * @access public * @param string - * @param integer number of repeats + * @param int number of repeats * @return string */ if ( ! function_exists('repeater')) { function repeater($data, $num = 1) { - return (($num > 0) ? str_repeat($data, $num) : ''); + return ($num > 0) ? str_repeat($data, $num) : ''; } } - /* End of file string_helper.php */ /* Location: ./system/helpers/string_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From b75faa1a03a32330e412f0bd0332fb9fa389e914 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 27 Apr 2012 12:03:32 -0400 Subject: Fix rest of the helpers --- system/helpers/string_helper.php | 204 +++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 102 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index aed35c157..b42799a8e 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -37,22 +37,22 @@ // ------------------------------------------------------------------------ -/** - * Trim Slashes - * - * Removes any leading/trailing slashes from a string: - * - * /this/that/theother/ - * - * becomes: - * - * this/that/theother - * - * @param string - * @return string - */ if ( ! function_exists('trim_slashes')) { + /** + * Trim Slashes + * + * Removes any leading/trailing slashes from a string: + * + * /this/that/theother/ + * + * becomes: + * + * this/that/theother + * + * @param string + * @return string + */ function trim_slashes($str) { return trim($str, '/'); @@ -61,16 +61,16 @@ if ( ! function_exists('trim_slashes')) // ------------------------------------------------------------------------ -/** - * Strip Slashes - * - * Removes slashes contained in a string or in an array - * - * @param mixed string or array - * @return mixed string or array - */ if ( ! function_exists('strip_slashes')) { + /** + * Strip Slashes + * + * Removes slashes contained in a string or in an array + * + * @param mixed string or array + * @return mixed string or array + */ function strip_slashes($str) { if (is_array($str)) @@ -91,16 +91,16 @@ if ( ! function_exists('strip_slashes')) // ------------------------------------------------------------------------ -/** - * Strip Quotes - * - * Removes single and double quotes from a string - * - * @param string - * @return string - */ if ( ! function_exists('strip_quotes')) { + /** + * Strip Quotes + * + * Removes single and double quotes from a string + * + * @param string + * @return string + */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); @@ -109,16 +109,16 @@ if ( ! function_exists('strip_quotes')) // ------------------------------------------------------------------------ -/** - * Quotes to Entities - * - * Converts single and double quotes to entities - * - * @param string - * @return string - */ if ( ! function_exists('quotes_to_entities')) { + /** + * Quotes to Entities + * + * Converts single and double quotes to entities + * + * @param string + * @return string + */ function quotes_to_entities($str) { return str_replace(array("\'","\"","'",'"'), array("'",""","'","""), $str); @@ -127,23 +127,23 @@ if ( ! function_exists('quotes_to_entities')) // ------------------------------------------------------------------------ -/** - * Reduce Double Slashes - * - * Converts double slashes in a string to a single slash, - * except those found in http:// - * - * http://www.some-site.com//index.php - * - * becomes: - * - * http://www.some-site.com/index.php - * - * @param string - * @return string - */ if ( ! function_exists('reduce_double_slashes')) { + /** + * Reduce Double Slashes + * + * Converts double slashes in a string to a single slash, + * except those found in http:// + * + * http://www.some-site.com//index.php + * + * becomes: + * + * http://www.some-site.com/index.php + * + * @param string + * @return string + */ function reduce_double_slashes($str) { return preg_replace('#(^|[^:])//+#', '\\1/', $str); @@ -152,24 +152,24 @@ if ( ! function_exists('reduce_double_slashes')) // ------------------------------------------------------------------------ -/** - * Reduce Multiples - * - * Reduces multiple instances of a particular character. Example: - * - * Fred, Bill,, Joe, Jimmy - * - * becomes: - * - * Fred, Bill, Joe, Jimmy - * - * @param string - * @param string the character you wish to reduce - * @param bool TRUE/FALSE - whether to trim the character from the beginning/end - * @return string - */ if ( ! function_exists('reduce_multiples')) { + /** + * Reduce Multiples + * + * Reduces multiple instances of a particular character. Example: + * + * Fred, Bill,, Joe, Jimmy + * + * becomes: + * + * Fred, Bill, Joe, Jimmy + * + * @param string + * @param string the character you wish to reduce + * @param bool TRUE/FALSE - whether to trim the character from the beginning/end + * @return string + */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $str = preg_replace('#'.preg_quote($character, '#').'{2,}#', $character, $str); @@ -185,17 +185,17 @@ if ( ! function_exists('reduce_multiples')) // ------------------------------------------------------------------------ -/** - * Create a Random String - * - * Useful for generating passwords or hashes. - * - * @param string type of random string. basic, alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1 - * @param int number of characters - * @return string - */ if ( ! function_exists('random_string')) { + /** + * Create a Random String + * + * Useful for generating passwords or hashes. + * + * @param string type of random string. basic, alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1 + * @param int number of characters + * @return string + */ function random_string($type = 'alnum', $len = 8) { switch($type) @@ -242,16 +242,16 @@ if ( ! function_exists('random_string')) // ------------------------------------------------------------------------ -/** - * Add's _1 to a string or increment the ending number to allow _2, _3, etc - * - * @param string required - * @param string What should the duplicate number be appended with - * @param string Which number should be used for the first dupe increment - * @return string - */ if ( ! function_exists('increment_string')) { + /** + * Add's _1 to a string or increment the ending number to allow _2, _3, etc + * + * @param string required + * @param string What should the duplicate number be appended with + * @param string Which number should be used for the first dupe increment + * @return string + */ function increment_string($str, $separator = '_', $first = 1) { preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); @@ -262,17 +262,17 @@ if ( ! function_exists('increment_string')) // ------------------------------------------------------------------------ -/** - * Alternator - * - * Allows strings to be alternated. See docs... - * - * @param string (as many parameters as needed) - * @return string - */ if ( ! function_exists('alternator')) { - function alternator() + /** + * Alternator + * + * Allows strings to be alternated. See docs... + * + * @param string (as many parameters as needed) + * @return string + */ + function alternator($args) { static $i; @@ -288,15 +288,15 @@ if ( ! function_exists('alternator')) // ------------------------------------------------------------------------ -/** - * Repeater function - * - * @param string - * @param int number of repeats - * @return string - */ if ( ! function_exists('repeater')) { + /** + * Repeater function + * + * @param string + * @param int number of repeats + * @return string + */ function repeater($data, $num = 1) { return ($num > 0) ? str_repeat($data, $num) : ''; -- cgit v1.2.3-24-g4f1b From 773ccc318f2769c9b7579630569b5d8ba47b114b Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:11:08 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/helpers --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 0c47d440a..4eee2a262 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -259,7 +259,7 @@ if ( ! function_exists('alternator')) { static $i; - if (func_num_args() == 0) + if (func_num_args() === 0) { $i = 0; return ''; -- cgit v1.2.3-24-g4f1b From 60826db46d3f9ceabcc280c494a975007423e64a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 27 Oct 2012 14:45:23 +0300 Subject: Deprecate string helper repeater() (an alias for str_repeat()) --- system/helpers/string_helper.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 4eee2a262..c5c493452 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -276,8 +276,11 @@ if ( ! function_exists('repeater')) /** * Repeater function * - * @param string - * @param int number of repeats + * @todo Remove in version 3.1+. + * @deprecated 3.0.0 This is just an alias for PHP's native str_repeat() + * + * @param string $data String to repeat + * @param int $num Number of repeats * @return string */ function repeater($data, $num = 1) -- cgit v1.2.3-24-g4f1b From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/helpers/string_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index c5c493452..c895d5767 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,4 +1,4 @@ - Date: Thu, 8 Nov 2012 22:01:33 +0200 Subject: Deprecate String helper trim_slashes() trim(, '/') is even shorter ... --- system/helpers/string_helper.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index c895d5767..5177a7e59 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -51,6 +51,9 @@ if ( ! function_exists('trim_slashes')) * * this/that/theother * + * @todo Remove in version 3.1+. + * @deprecated 3.0.0 This is just an alias for PHP's native trim() + * * @param string * @return string */ -- cgit v1.2.3-24-g4f1b From 442682e488181a9e9139f02bb657e501eb78573d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 8 Nov 2012 22:52:12 +0200 Subject: Polish docs for String, Text and Typography helpers --- system/helpers/string_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 5177a7e59..9fc24559a 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -218,10 +218,10 @@ if ( ! function_exists('random_string')) break; } return substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len); - case 'unique': + case 'unique': // todo: remove in 3.1+ case 'md5': return md5(uniqid(mt_rand())); - case 'encrypt': + case 'encrypt': // todo: remove in 3.1+ case 'sha1': return sha1(uniqid(mt_rand(), TRUE)); } -- cgit v1.2.3-24-g4f1b From 80500afbd188600212ca913a7bac073009feac73 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 1 Jan 2013 08:16:53 +0200 Subject: [ci skip] Happy new year --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 9fc24559a..12f818fda 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 08dd57c567d37a0c94faa607f2fef331c9d1db0a Mon Sep 17 00:00:00 2001 From: Olanipekun Femi Date: Fri, 7 Feb 2014 08:16:48 -0800 Subject: Fixed Typo in String Helper function alnum spelled as alunum in random_string function documentation comment. --- system/helpers/string_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 12f818fda..777acba0b 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -188,7 +188,7 @@ if ( ! function_exists('random_string')) * * Useful for generating passwords or hashes. * - * @param string type of random string. basic, alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1 + * @param string type of random string. basic, alpha, alnum, numeric, nozero, unique, md5, encrypt and sha1 * @param int number of characters * @return string */ @@ -294,4 +294,4 @@ if ( ! function_exists('repeater')) } /* End of file string_helper.php */ -/* Location: ./system/helpers/string_helper.php */ \ No newline at end of file +/* Location: ./system/helpers/string_helper.php */ -- cgit v1.2.3-24-g4f1b From c7d82d8f3ca2531fbec82344c528d269dcffff08 Mon Sep 17 00:00:00 2001 From: iolufemi Date: Sun, 9 Feb 2014 22:39:22 +0100 Subject: Removed new line at the end of file locally. --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 777acba0b..4be7f294b 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -294,4 +294,4 @@ if ( ! function_exists('repeater')) } /* End of file string_helper.php */ -/* Location: ./system/helpers/string_helper.php */ +/* Location: ./system/helpers/string_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 871754af60251993d640981e107d2def5f2db396 Mon Sep 17 00:00:00 2001 From: darwinel Date: Tue, 11 Feb 2014 17:34:57 +0100 Subject: 2013 > 2014 Update copyright notices from 2013 to 2014. And update one calendar example in user_guide from year 2013/2014 to 2014/2015. --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 4be7f294b..a1daa1efe 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From bdb96ca1b1dbfc1791172fd169d7751cbc4d7d55 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Oct 2014 00:13:31 +0200 Subject: [ci skip] Switch to MIT license; close #3293 --- system/helpers/string_helper.php | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index a1daa1efe..60607e95c 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -4,24 +4,35 @@ * * An open source application development framework for PHP 5.2.4 or newer * - * NOTICE OF LICENSE + * This content is released under the MIT License (MIT) * - * Licensed under the Open Software License version 3.0 + * Copyright (c) 2014, British Columbia Institute of Technology * - * This source file is subject to the Open Software License (OSL 3.0) that is - * bundled with this package in the files license.txt / license.rst. It is - * also available through the world wide web at this URL: - * http://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to obtain it - * through the world wide web, please send an email to - * licensing@ellislab.com so we can send you a copy immediately. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * @package CodeIgniter - * @author EllisLab Dev Team + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @package CodeIgniter + * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * @link http://codeigniter.com - * @since Version 1.0 + * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @license http://opensource.org/licenses/MIT MIT License + * @link http://codeigniter.com + * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); -- cgit v1.2.3-24-g4f1b From fe9309d22c1b088f5363954d6dac013c8c955894 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 Jan 2015 17:48:58 +0200 Subject: Bulk (mostly documentation) update - Remove PHP version from license notices - Bump year number in copyright notices - Recommend PHP 5.4 or newer to be used - Tell Travis-CI to test on PHP 5.3.0 instead of the latest 5.3 version Related: #3450 --- system/helpers/string_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 60607e95c..5daae987c 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.2.4 or newer + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014, British Columbia Institute of Technology + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 4cbe463b4c442e0e2dae2f43565e77f7ac5ecb86 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Wed, 21 Jan 2015 22:56:22 +0100 Subject: Remove closing blocks at end of PHP files --- system/helpers/string_helper.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 5daae987c..5860e15fb 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -303,6 +303,3 @@ if ( ! function_exists('repeater')) return ($num > 0) ? str_repeat($data, $num) : ''; } } - -/* End of file string_helper.php */ -/* Location: ./system/helpers/string_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 36bd3413be0807fe358d87856b3a2f42047764fd Mon Sep 17 00:00:00 2001 From: Kevin Morssink Date: Tue, 4 Aug 2015 19:05:46 +0200 Subject: Fix ReDoS-bug in string_helper.php Fix for ReDoS (Regular Expression Denial of Service) / Code Injection Risk --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 5860e15fb..28e6ab15f 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -253,7 +253,7 @@ if ( ! function_exists('increment_string')) */ function increment_string($str, $separator = '_', $first = 1) { - preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); + preg_match('/(.+)' . preg_quote($separator) . '([0-9]+)$/', $str, $match); return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first; } } -- cgit v1.2.3-24-g4f1b From 9bb9469cabd15eb8e8e15fa3b2740bf92bc16ff4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Aug 2015 13:29:11 +0300 Subject: Fix #4023 Close #4024 --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 28e6ab15f..637835160 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -253,7 +253,7 @@ if ( ! function_exists('increment_string')) */ function increment_string($str, $separator = '_', $first = 1) { - preg_match('/(.+)' . preg_quote($separator) . '([0-9]+)$/', $str, $match); + preg_match('/(.+)'.preg_quote($separator, '/').'([0-9]+)$/', $str, $match); return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first; } } -- cgit v1.2.3-24-g4f1b From a18c6097a38f7b3eac789b5c217a97d7ac0b7085 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 3 Dec 2015 17:53:14 +0200 Subject: Fix #4283 --- system/helpers/string_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 637835160..3138a04b3 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -270,7 +270,7 @@ if ( ! function_exists('alternator')) * @param string (as many parameters as needed) * @return string */ - function alternator($args) + function alternator() { static $i; @@ -279,6 +279,7 @@ if ( ! function_exists('alternator')) $i = 0; return ''; } + $args = func_get_args(); return $args[($i++ % count($args))]; } -- cgit v1.2.3-24-g4f1b From 125ef4751080a2118cb203357d77687699e3eb25 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:33:00 +0200 Subject: [ci skip] Bump year to 2016 --- system/helpers/string_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 3138a04b3..98cf882e0 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology + * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From bd202c91b0e9cf0a8c93bcaa71df9574f5909346 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:50:18 +0200 Subject: [ci skip] Update codeigniter.com links to https --- system/helpers/string_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 98cf882e0..70172270e 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License - * @link http://codeigniter.com + * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ @@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @subpackage Helpers * @category Helpers * @author EllisLab Dev Team - * @link http://codeigniter.com/user_guide/helpers/string_helper.html + * @link https://codeigniter.com/user_guide/helpers/string_helper.html */ // ------------------------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 1924e879b165fb119847a49a7a5eab2f28295fa2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:55:34 +0200 Subject: [ci skip] Update ellislab.com links to https too --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 70172270e..db531fa9a 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -28,7 +28,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com -- cgit v1.2.3-24-g4f1b From da60e9bc66ec90970fbd2dfd08b0a6e66b9f5f5f Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sat, 31 Dec 2016 08:46:18 -0800 Subject: Update copyright data to 2017 --- system/helpers/string_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index db531fa9a..23608e5f4 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2016, British Columbia Institute of Technology + * Copyright (c) 2014 - 2017, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) - * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 618870f9f70148944599c1db64babec09e7424bc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 1 Mar 2017 14:09:26 +0200 Subject: [ci skip] Remove a misleading comment from the docblock for random_string() --- system/helpers/string_helper.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'system/helpers/string_helper.php') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 23608e5f4..93446b82f 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -195,9 +195,7 @@ if ( ! function_exists('reduce_multiples')) if ( ! function_exists('random_string')) { /** - * Create a Random String - * - * Useful for generating passwords or hashes. + * Create a "Random" String * * @param string type of random string. basic, alpha, alnum, numeric, nozero, unique, md5, encrypt and sha1 * @param int number of characters -- cgit v1.2.3-24-g4f1b