summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-06-28 10:49:01 +0200
committerAndrey Andreev <narf@devilix.net>2017-06-28 10:49:01 +0200
commitbe0280d02a408a8b4aeb6aee10d9dd936f978ce2 (patch)
tree299ba5d5a322d01bcaa695df98125063b12ca40b /system/core
parentdb89c20721b3b66671db9ff4d3b6c9a6de352533 (diff)
#5164 fix for stock libraries
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Loader.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index cae01ed38..12922ca64 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -1041,7 +1041,7 @@ class CI_Loader {
if (class_exists($class, FALSE))
{
$property = $object_name;
- if ( ! isset($property))
+ if (empty($property))
{
$property = strtolower($class);
isset($this->_ci_varmap[$property]) && $property = $this->_ci_varmap[$property];
@@ -1113,16 +1113,17 @@ class CI_Loader {
$prefix = config_item('subclass_prefix');
}
- // Before we deem this to be a duplicate request, let's see
- // if a custom object name is being supplied. If so, we'll
- // return a new instance of the object
- if ($object_name !== NULL)
+ $property = $object_name;
+ if (empty($property))
{
- $CI =& get_instance();
- if ( ! isset($CI->$object_name))
- {
- return $this->_ci_init_library($library_name, $prefix, $params, $object_name);
- }
+ $property = strtolower($library_name);
+ isset($this->_ci_varmap[$property]) && $property = $this->_ci_varmap[$property];
+ }
+
+ $CI =& get_instance();
+ if ( ! isset($CI->$property))
+ {
+ return $this->_ci_init_library($library_name, $prefix, $params, $object_name);
}
log_message('debug', $library_name.' class already loaded. Second attempt ignored.');