Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit a5abcaf

Browse files
author
Emmanuel Campait
committed
Update CodeIgniter 3.1.0
1 parent 560bb89 commit a5abcaf

58 files changed

Lines changed: 1019 additions & 395 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CI-AdminLTE v1.4.1
1+
# CI-AdminLTE v1.4.2
22

33
## Demo
44

@@ -20,7 +20,7 @@ Support for most major browsers including Chrome, Firefox, IE9+, Opera and Safar
2020
## Dependencies
2121
| NAME | VERSION | WEB | REPO |
2222
| :--- | :---: | :---: | :---: |
23-
| CodeIgniter | 3.0.6 | [Website](http://codeigniter.com) | [Github](https://github.com/bcit-ci/CodeIgniter/)
23+
| CodeIgniter | 3.1.0 | [Website](http://codeigniter.com) | [Github](https://github.com/bcit-ci/CodeIgniter/)
2424
| AdminLTE | 2.3.5 | [Website](https://almsaeedstudio.com) | [Github](https://github.com/almasaeed2010/AdminLTE/)
2525
| Bootstrap | 3.3.7 | [Website](http://getbootstrap.com) | [Github](https://github.com/twbs/bootstrap)
2626
| Ion Auth | 2.6.0 | [Website](http://benedmunds.com/ion_auth) | [Github](https://github.com/benedmunds/CodeIgniter-Ion-Auth)

system/core/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* @var string
5656
*
5757
*/
58-
define('CI_VERSION', '3.0.6');
58+
define('CI_VERSION', '3.1.0');
5959

6060
/*
6161
* ------------------------------------------------------

system/core/Common.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function is_https()
355355
{
356356
return TRUE;
357357
}
358-
elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
358+
elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https')
359359
{
360360
return TRUE;
361361
}
@@ -716,8 +716,8 @@ function remove_invisible_characters($str, $url_encoded = TRUE)
716716
// carriage return (dec 13) and horizontal tab (dec 09)
717717
if ($url_encoded)
718718
{
719-
$non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15
720-
$non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31
719+
$non_displayables[] = '/%0[0-8bcef]/i'; // url encoded 00-08, 11, 12, 14, 15
720+
$non_displayables[] = '/%1[0-9a-f]/i'; // url encoded 16-31
721721
}
722722

723723
$non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127

system/core/Config.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public function base_url($uri = '', $protocol = NULL)
319319
}
320320
}
321321

322-
return $base_url.ltrim($this->_uri_string($uri), '/');
322+
return $base_url.$this->_uri_string($uri);
323323
}
324324

325325
// -------------------------------------------------------------
@@ -337,11 +337,8 @@ protected function _uri_string($uri)
337337
{
338338
if ($this->item('enable_query_strings') === FALSE)
339339
{
340-
if (is_array($uri))
341-
{
342-
$uri = implode('/', $uri);
343-
}
344-
return trim($uri, '/');
340+
is_array($uri) && $uri = implode('/', $uri);
341+
return ltrim($uri, '/');
345342
}
346343
elseif (is_array($uri))
347344
{

system/core/Input.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ public function ip_address()
519519
if ($separator === ':')
520520
{
521521
$netaddr = explode(':', str_replace('::', str_repeat(':', 9 - substr_count($netaddr, ':')), $netaddr));
522-
for ($i = 0; $i < 8; $i++)
522+
for ($j = 0; $j < 8; $j++)
523523
{
524-
$netaddr[$i] = intval($netaddr[$i], 16);
524+
$netaddr[$i] = intval($netaddr[$j], 16);
525525
}
526526
}
527527
else
@@ -760,30 +760,32 @@ public function request_headers($xss_clean = FALSE)
760760
// If header is already defined, return it immediately
761761
if ( ! empty($this->headers))
762762
{
763-
return $this->headers;
763+
return $this->_fetch_from_array($this->headers, NULL, $xss_clean);
764764
}
765765

766766
// In Apache, you can simply call apache_request_headers()
767767
if (function_exists('apache_request_headers'))
768768
{
769-
return $this->headers = apache_request_headers();
769+
$this->headers = apache_request_headers();
770770
}
771-
772-
$this->headers['Content-Type'] = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
773-
774-
foreach ($_SERVER as $key => $val)
771+
else
775772
{
776-
if (sscanf($key, 'HTTP_%s', $header) === 1)
773+
isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE'];
774+
775+
foreach ($_SERVER as $key => $val)
777776
{
778-
// take SOME_HEADER and turn it into Some-Header
779-
$header = str_replace('_', ' ', strtolower($header));
780-
$header = str_replace(' ', '-', ucwords($header));
777+
if (sscanf($key, 'HTTP_%s', $header) === 1)
778+
{
779+
// take SOME_HEADER and turn it into Some-Header
780+
$header = str_replace('_', ' ', strtolower($header));
781+
$header = str_replace(' ', '-', ucwords($header));
781782

782-
$this->headers[$header] = $this->_fetch_from_array($_SERVER, $key, $xss_clean);
783+
$this->headers[$header] = $_SERVER[$key];
784+
}
783785
}
784786
}
785787

786-
return $this->headers;
788+
return $this->_fetch_from_array($this->headers, NULL, $xss_clean);
787789
}
788790

789791
// --------------------------------------------------------------------

system/core/Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ protected function _ci_load_library($class, $params = NULL, $object_name = NULL)
11061106
* @used-by CI_Loader::_ci_load_library()
11071107
* @uses CI_Loader::_ci_init_library()
11081108
*
1109-
* @param string $library Library name to load
1109+
* @param string $library_name Library name to load
11101110
* @param string $file_path Path to the library filename, relative to libraries/
11111111
* @param mixed $params Optional parameters to pass to the class constructor
11121112
* @param string $object_name Optional object name to assign to

system/core/Log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public function write_log($level, $msg)
237237
*
238238
* @param string $level The error level
239239
* @param string $date Formatted date string
240-
* @param string $msg The log message
240+
* @param string $message The log message
241241
* @return string Formatted log line with a new line character '\n' at the end
242242
*/
243243
protected function _format_line($level, $date, $message)

system/core/Output.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public function get_content_type()
285285
/**
286286
* Get Header
287287
*
288-
* @param string $header_name
288+
* @param string $header
289289
* @return string
290290
*/
291291
public function get_header($header)

system/core/compat/password.php

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,21 @@ function password_hash($password, $algo, array $options = array())
116116
}
117117
elseif ( ! isset($options['salt']))
118118
{
119-
if (defined('MCRYPT_DEV_URANDOM'))
119+
if (function_exists('random_bytes'))
120120
{
121-
$options['salt'] = mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);
121+
try
122+
{
123+
$options['salt'] = random_bytes(16);
124+
}
125+
catch (Exception $e)
126+
{
127+
log_message('error', 'compat/password: Error while trying to use random_bytes(): '.$e->getMessage());
128+
return FALSE;
129+
}
122130
}
123-
elseif (function_exists('openssl_random_pseudo_bytes'))
131+
elseif (defined('MCRYPT_DEV_URANDOM'))
124132
{
125-
$options['salt'] = openssl_random_pseudo_bytes(16);
133+
$options['salt'] = mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);
126134
}
127135
elseif (DIRECTORY_SEPARATOR === '/' && (is_readable($dev = '/dev/arandom') OR is_readable($dev = '/dev/urandom')))
128136
{
@@ -148,6 +156,16 @@ function password_hash($password, $algo, array $options = array())
148156

149157
fclose($fp);
150158
}
159+
elseif (function_exists('openssl_random_pseudo_bytes'))
160+
{
161+
$is_secure = NULL;
162+
$options['salt'] = openssl_random_pseudo_bytes(16, $is_secure);
163+
if ($is_secure !== TRUE)
164+
{
165+
log_message('error', 'compat/password: openssl_random_pseudo_bytes() set the $cryto_strong flag to FALSE');
166+
return FALSE;
167+
}
168+
}
151169
else
152170
{
153171
log_message('error', 'compat/password: No CSPRNG available.');

system/core/compat/standard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* array_column()
6363
*
6464
* @link http://php.net/array_column
65-
* @param string $array
65+
* @param array $array
6666
* @param mixed $column_key
6767
* @param mixed $index_key
6868
* @return array

0 commit comments

Comments
 (0)