From 845ed89709f84d56edeeb91e877f585a5798006d Mon Sep 17 00:00:00 2001 From: Nate Silva Date: Thu, 5 Nov 2015 13:43:53 -0800 Subject: Build base_url correctly if SERVER_ADDR is IPv6 --- system/core/Config.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index 0264776f9..dfef8dbe4 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -90,7 +90,15 @@ class CI_Config { { if (isset($_SERVER['SERVER_ADDR'])) { - $base_url = (is_https() ? 'https' : 'http').'://'.$_SERVER['SERVER_ADDR'] + if ((bool) filter_var($_SERVER['SERVER_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) + { + $server_addr = '[' . $_SERVER['SERVER_ADDR'] . ']'; + } + else + { + $server_addr = $_SERVER['SERVER_ADDR']; + } + $base_url = (is_https() ? 'https' : 'http').'://'.$server_addr .substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME']))); } else -- cgit v1.2.3-24-g4f1b From 4ccf88dc97d009e3421b79c351e426d31fc11b41 Mon Sep 17 00:00:00 2001 From: Nate Silva Date: Fri, 6 Nov 2015 07:06:28 -0800 Subject: Simpler way to detect an IPv6 address (strpos) --- system/core/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index dfef8dbe4..87ed32aca 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -90,7 +90,7 @@ class CI_Config { { if (isset($_SERVER['SERVER_ADDR'])) { - if ((bool) filter_var($_SERVER['SERVER_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) + if (strpos($_SERVER['SERVER_ADDR'], ':') !== FALSE) { $server_addr = '[' . $_SERVER['SERVER_ADDR'] . ']'; } -- cgit v1.2.3-24-g4f1b From e735b1dfe14d1d6d955d142a30e8c83ba900fe2b Mon Sep 17 00:00:00 2001 From: Nate Silva Date: Fri, 6 Nov 2015 07:07:11 -0800 Subject: Tweak to match CI coding style --- system/core/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index 87ed32aca..1d2a0d155 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -92,7 +92,7 @@ class CI_Config { { if (strpos($_SERVER['SERVER_ADDR'], ':') !== FALSE) { - $server_addr = '[' . $_SERVER['SERVER_ADDR'] . ']'; + $server_addr = '['.$_SERVER['SERVER_ADDR'].']'; } else { -- cgit v1.2.3-24-g4f1b From ae480daecb0f7aeed017c5cc5a67cc39b90be570 Mon Sep 17 00:00:00 2001 From: Nate Silva Date: Fri, 6 Nov 2015 07:10:44 -0800 Subject: Minor formatting: add empty line after else close --- system/core/Config.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index 1d2a0d155..c507f342c 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -98,6 +98,7 @@ class CI_Config { { $server_addr = $_SERVER['SERVER_ADDR']; } + $base_url = (is_https() ? 'https' : 'http').'://'.$server_addr .substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME']))); } -- cgit v1.2.3-24-g4f1b From fa34429e85b4bf452ba595072124a884ca3e8b89 Mon Sep 17 00:00:00 2001 From: sprakash4 Date: Fri, 26 Feb 2016 16:02:07 -0800 Subject: Downgraded log level for some pesky messages to INFO --- system/core/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index ca6fb3793..5c6ba2a4d 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -169,7 +169,7 @@ class CI_Config { $this->is_loaded[] = $file_path; $config = NULL; $loaded = TRUE; - log_message('debug', 'Config file loaded: '.$file_path); + log_message('info', 'Config file loaded: '.$file_path); } } -- cgit v1.2.3-24-g4f1b From edbbc7dfc01ce05a1c37629df0e1b4c8d00c435f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Dec 2016 14:49:08 +0200 Subject: Remove previously deprecated CI_Config::system_url() --- system/core/Config.php | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index e74751639..6704a0a7e 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -350,20 +350,6 @@ class CI_Config { // -------------------------------------------------------------------- - /** - * System URL - * - * @deprecated 3.0.0 Encourages insecure practices - * @return string - */ - public function system_url() - { - $x = explode('/', preg_replace('|/*(.+?)/*$|', '\\1', BASEPATH)); - return $this->slash_item('base_url').end($x).'/'; - } - - // -------------------------------------------------------------------- - /** * Set a config file item * -- 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/core/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index 6704a0a7e..d7236df1f 100644 --- a/system/core/Config.php +++ b/system/core/Config.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 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/core/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index d7236df1f..ca453668e 100644 --- a/system/core/Config.php +++ b/system/core/Config.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 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/core/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index ca453668e..631de749f 100644 --- a/system/core/Config.php +++ b/system/core/Config.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 -- 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/core/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index 631de749f..13cc087d0 100644 --- a/system/core/Config.php +++ b/system/core/Config.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/core/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Config.php') diff --git a/system/core/Config.php b/system/core/Config.php index 13cc087d0..e6eb0ad95 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @subpackage Libraries * @category Libraries * @author EllisLab Dev Team - * @link https://codeigniter.com/user_guide/libraries/config.html + * @link https://codeigniter.com/userguide3/libraries/config.html */ class CI_Config { -- cgit v1.2.3-24-g4f1b