From e837d3589ba5c5da5daa58f69bdc14447c90bc51 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 5 Jan 2022 23:44:53 +0200 Subject: Drop some previously deprecated functionality --- system/helpers/string_helper.php | 4 +--- system/helpers/url_helper.php | 15 ++------------- 2 files changed, 3 insertions(+), 16 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 3a05525db..5b359f730 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -170,7 +170,7 @@ if ( ! function_exists('random_string')) /** * Create a "Random" String * - * @param string type of random string. basic, alpha, alnum, numeric, nozero, unique, md5, encrypt and sha1 + * @param string type of random string. basic, alpha, alnum, numeric, nozero, md5 and sha1 * @param int number of characters * @return string */ @@ -200,10 +200,8 @@ if ( ! function_exists('random_string')) break; } return substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len); - case 'unique': // todo: remove in 3.1+ case 'md5': return md5(uniqid(mt_rand())); - case 'encrypt': // todo: remove in 3.1+ case 'sha1': return sha1(uniqid(mt_rand(), TRUE)); } diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 4c060a203..17601c40c 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -470,31 +470,20 @@ if ( ! function_exists('url_title')) * human-friendly URL string with a "separator" string * as the word separator. * - * @todo Remove old 'dash' and 'underscore' usage in 3.1+. * @param string $str Input string - * @param string $separator Word separator - * (usually '-' or '_') + * @param string $separator Word separator (usually '-' or '_') * @param bool $lowercase Whether to transform the output string to lowercase * @return string */ function url_title($str, $separator = '-', $lowercase = FALSE) { - if ($separator === 'dash') - { - $separator = '-'; - } - elseif ($separator === 'underscore') - { - $separator = '_'; - } - $q_separator = preg_quote($separator, '#'); $trans = array( '&.+?;' => '', '[^\w\d _-]' => '', '\s+' => $separator, - '('.$q_separator.')+' => $separator + '('.$q_separator.')+' => $separator, ); $str = strip_tags($str); -- cgit v1.2.3-24-g4f1b