From b6ed3d102dc7c8e2a591405e56aa780d64d385d6 Mon Sep 17 00:00:00 2001 From: Vivek Dinesh Date: Thu, 11 Aug 2016 17:40:45 +0530 Subject: URI schemes are not case-sensitive Signed-off-by: Vivek Dinesh --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index fd7b5e116..82b9e02af 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -443,7 +443,7 @@ if ( ! function_exists('prep_url')) */ function prep_url($str = '') { - if ($str === 'http://' OR $str === '') + if (strtolower($str) === 'http://' OR $str === '') { return ''; } -- cgit v1.2.3-24-g4f1b From 669cc5f881970ec3cc19b57f4da0382c7d8f5542 Mon Sep 17 00:00:00 2001 From: Vivek Dinesh Date: Thu, 11 Aug 2016 18:21:11 +0530 Subject: Removed useless checks Based on GitHub discussion. Signed-off-by: Vivek Dinesh --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 82b9e02af..8a5a75c44 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -443,7 +443,7 @@ if ( ! function_exists('prep_url')) */ function prep_url($str = '') { - if (strtolower($str) === 'http://' OR $str === '') + if ($str === '') { return ''; } -- cgit v1.2.3-24-g4f1b From fced25f5728ce81fe810216fcaa4ccec7523f6c9 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/url_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 8a5a75c44..99e82ef9f 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_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 3e59801223f1393507d81e9f394c4f5ae33e1c04 Mon Sep 17 00:00:00 2001 From: Uekawa Date: Fri, 29 Sep 2017 15:10:41 +0900 Subject: Fix auto_link --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 system/helpers/url_helper.php (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php old mode 100644 new mode 100755 index 99e82ef9f..421b3bad5 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -393,7 +393,7 @@ if ( ! function_exists('auto_link')) function auto_link($str, $type = 'both', $popup = FALSE) { // Find and replace any URLs. - if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) + if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w/?#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { // Set our target HTML if using popup links. $target = ($popup) ? ' target="_blank"' : ''; -- cgit v1.2.3-24-g4f1b From db92b5b336cbc6603f613916bde55940c9c24a05 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 29 Sep 2017 12:02:06 +0300 Subject: [ci skip] Revert file permission change from PR #5278 --- system/helpers/url_helper.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 system/helpers/url_helper.php (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php old mode 100755 new mode 100644 -- cgit v1.2.3-24-g4f1b From 208381009ed12768478b2e8110bfb6e506acc3e1 Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Tue, 9 Jan 2018 00:53:27 -0800 Subject: Annual copyright update --- system/helpers/url_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 2e09534f5..e5d2d372f 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2017, British Columbia Institute of Technology + * Copyright (c) 2014 - 2018, 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 - 2017, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2018, 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 459eaa897191cceb674820a6a9e2630f7ca1350f Mon Sep 17 00:00:00 2001 From: Mehdi Bounya <5004111+mehdibo@users.noreply.github.com> Date: Sun, 28 Jan 2018 19:29:29 +0000 Subject: Added rel attribute to auto_link() Fixed security issue: allowing the target page to take control of the original page Details about the issue here: https://mathiasbynens.github.io/rel-noopener/ --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index e5d2d372f..3eb2cb0b0 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -396,7 +396,7 @@ if ( ! function_exists('auto_link')) if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[a-z0-9]+(-+[a-z0-9]+)*(\.[a-z0-9]+(-+[a-z0-9]+)*)+(/([^\s()<>;]+\w)?/?)?#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { // Set our target HTML if using popup links. - $target = ($popup) ? ' target="_blank"' : ''; + $target = ($popup) ? ' target="_blank" rel="noopener"' : ''; // We process the links in reverse order (last -> first) so that // the returned string offsets from preg_match_all() are not -- cgit v1.2.3-24-g4f1b From 52a87e506d4fc70bd5922b07a532852d28f28ab6 Mon Sep 17 00:00:00 2001 From: Mehdi Bounya Date: Thu, 17 May 2018 23:41:30 +0000 Subject: http:// to https:// --- system/helpers/url_helper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 3eb2cb0b0..f99343ff1 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -29,8 +29,8 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) - * @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/) - * @license http://opensource.org/licenses/MIT MIT License + * @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (https://bcit.ca/) + * @license https://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 * @filesource @@ -211,7 +211,7 @@ if ( ! function_exists('anchor_popup')) { $attributes = array($attributes); - // Ref: http://www.w3schools.com/jsref/met_win_open.asp + // Ref: https://www.w3schools.com/jsref/met_win_open.asp $window_name = '_blank'; } elseif ( ! empty($attributes['window_name'])) @@ -546,7 +546,7 @@ if ( ! function_exists('redirect')) if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1') { $code = ($_SERVER['REQUEST_METHOD'] !== 'GET') - ? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get + ? 303 // reference: https://en.wikipedia.org/wiki/Post/Redirect/Get : 307; } else -- cgit v1.2.3-24-g4f1b From 8bb638e392f5991c05ec9a1e57b882213844dc6f Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Wed, 26 Dec 2018 21:03:09 -0800 Subject: Update copyright date to 2019 --- system/helpers/url_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index f99343ff1..6a959f0e6 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2018, British Columbia Institute of Technology + * Copyright (c) 2014 - 2019, 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 - 2018, British Columbia Institute of Technology (https://bcit.ca/) + * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/) * @license https://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 6ba0207160f8f2b99c79dd285bccf45f574ec660 Mon Sep 17 00:00:00 2001 From: sapics Date: Wed, 24 Jun 2020 11:51:36 +0900 Subject: Fix user guide url Replace from https://codeigniter.com/user_guide/* to https://codeigniter.com/userguide3/* --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/url_helper.php') diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 6a959f0e6..4c060a203 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @subpackage Helpers * @category Helpers * @author EllisLab Dev Team - * @link https://codeigniter.com/user_guide/helpers/url_helper.html + * @link https://codeigniter.com/userguide3/helpers/url_helper.html */ // ------------------------------------------------------------------------ -- cgit v1.2.3-24-g4f1b 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/url_helper.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'system/helpers/url_helper.php') 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