summaryrefslogtreecommitdiffstats
path: root/system/core/Loader.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-01-10 20:58:09 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-01-10 20:58:09 +0100
commitb790371f328e49ed57eda85bf33817e033b85601 (patch)
tree302bec4305038ea0e7a8ddff3d989319cd89e283 /system/core/Loader.php
parente1a1464488076e4f501df6ba32ec1f6642f27855 (diff)
parentd47baab1bd4d655a68981834d11727ae8c2a3a45 (diff)
Merge pull request #906 from narfbg/develop-issue-904
Fix issue #904
Diffstat (limited to 'system/core/Loader.php')
-rw-r--r--system/core/Loader.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 272fe4291..12daaa928 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -250,10 +250,10 @@ class CI_Loader {
if (($last_slash = strrpos($model, '/')) !== FALSE)
{
// The path is in front of the last slash
- $path = substr($model, 0, $last_slash + 1);
+ $path = substr($model, 0, ++$last_slash);
// And the model name behind it
- $model = substr($model, $last_slash + 1);
+ $model = substr($model, $last_slash);
}
if ($name == '')
@@ -833,10 +833,9 @@ class CI_Loader {
// If the PHP installation does not support short tags we'll
// do a little string replacement, changing the short tags
// to standard PHP echo statements.
-
if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE)
{
- echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
+ echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
}
else
{
@@ -861,7 +860,6 @@ class CI_Loader {
* we are beyond the first level of output buffering so that
* it can be seen and included properly by the first included
* template and any subsequent ones. Oy!
- *
*/
if (ob_get_level() > $this->_ci_ob_level + 1)
{
@@ -1233,13 +1231,13 @@ class CI_Loader {
{
if ( ! is_array($filename))
{
- return array(strtolower(str_replace('.php', '', str_replace($extension, '', $filename)).$extension));
+ return array(strtolower(str_replace(array($extension, '.php'), '', $filename).$extension));
}
else
{
foreach ($filename as $key => $val)
{
- $filename[$key] = strtolower(str_replace('.php', '', str_replace($extension, '', $val)).$extension);
+ $filename[$key] = strtolower(str_replace(array($extension, '.php'), '', $val).$extension);
}
return $filename;