summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authortianhe1986 <w1s2j3229@163.com>2017-06-21 13:17:23 +0200
committertianhe1986 <w1s2j3229@163.com>2017-06-21 13:17:23 +0200
commit7b61ba41bbd431bdfb0ef11aca41b893e33f5c20 (patch)
treeb08e9c16de363eff4e801a018681d4e224f74411 /system/core
parent8186b6b398c26c0c1e0052eaddf4fc122e4929a5 (diff)
Always check whether a model be a subclass of CI_Model when loaded.
Signed-off-by: tianhe1986 <w1s2j3229@163.com>
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Loader.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 7279e8833..e6585ad3f 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -344,9 +344,10 @@ class CI_Loader {
throw new RuntimeException('Unable to locate the model you have specified: '.$model);
}
}
- elseif ( ! is_subclass_of($model, 'CI_Model'))
+
+ if ( ! is_subclass_of($model, 'CI_Model'))
{
- throw new RuntimeException("Class ".$model." already exists and doesn't extend CI_Model");
+ throw new RuntimeException("Class ".$model." doesn't extend CI_Model");
}
$this->_ci_models[] = $name;