Update to CodeIgniter 3.19
This commit is contained in:
@@ -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 - 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 - 2016, 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
|
||||
@@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @var string
|
||||
*
|
||||
*/
|
||||
define('CI_VERSION', '3.0.6');
|
||||
const CI_VERSION = '3.1.9';
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------
|
||||
@@ -67,7 +67,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
|
||||
}
|
||||
|
||||
require_once(APPPATH.'config/constants.php');
|
||||
if (file_exists(APPPATH.'config/constants.php'))
|
||||
{
|
||||
require_once(APPPATH.'config/constants.php');
|
||||
}
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------
|
||||
@@ -416,14 +419,29 @@ if ( ! is_php('5.4'))
|
||||
$params = array($method, array_slice($URI->rsegments, 2));
|
||||
$method = '_remap';
|
||||
}
|
||||
// WARNING: It appears that there are issues with is_callable() even in PHP 5.2!
|
||||
// Furthermore, there are bug reports and feature/change requests related to it
|
||||
// that make it unreliable to use in this context. Please, DO NOT change this
|
||||
// work-around until a better alternative is available.
|
||||
elseif ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE))
|
||||
elseif ( ! method_exists($class, $method))
|
||||
{
|
||||
$e404 = TRUE;
|
||||
}
|
||||
/**
|
||||
* DO NOT CHANGE THIS, NOTHING ELSE WORKS!
|
||||
*
|
||||
* - method_exists() returns true for non-public methods, which passes the previous elseif
|
||||
* - is_callable() returns false for PHP 4-style constructors, even if there's a __construct()
|
||||
* - method_exists($class, '__construct') won't work because CI_Controller::__construct() is inherited
|
||||
* - People will only complain if this doesn't work, even though it is documented that it shouldn't.
|
||||
*
|
||||
* ReflectionMethod::isConstructor() is the ONLY reliable check,
|
||||
* knowing which method will be executed as a constructor.
|
||||
*/
|
||||
elseif ( ! is_callable(array($class, $method)))
|
||||
{
|
||||
$reflection = new ReflectionMethod($class, $method);
|
||||
if ( ! $reflection->isPublic() OR $reflection->isConstructor())
|
||||
{
|
||||
$e404 = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($e404)
|
||||
|
Reference in New Issue
Block a user