Skip to content

Commit

Permalink
Merge pull request #906 from narfbg/develop-issue-904
Browse files Browse the repository at this point in the history
Fix issue #904
  • Loading branch information
Phil Sturgeon committed Jan 10, 2012
2 parents e1a1464 + d47baab commit b790371
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion system/core/Common.php
Expand Up @@ -199,7 +199,7 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_')
*/
if ( ! function_exists('is_loaded'))
{
function is_loaded($class = '')
function &is_loaded($class = '')
{
static $_is_loaded = array();

Expand Down
12 changes: 5 additions & 7 deletions system/core/Loader.php
Expand Up @@ -250,10 +250,10 @@ public function model($model, $name = '', $db_conn = FALSE)
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 == '')
Expand Down Expand Up @@ -833,10 +833,9 @@ protected function _ci_load($_ci_data)
// 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
{
Expand All @@ -861,7 +860,6 @@ protected function _ci_load($_ci_data)
* 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)
{
Expand Down Expand Up @@ -1233,13 +1231,13 @@ protected function _ci_prep_filename($filename, $extension)
{
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;
Expand Down
4 changes: 2 additions & 2 deletions user_guide_src/source/changelog.rst
Expand Up @@ -67,12 +67,12 @@ Release Date: Not Released
- Removed SHA1 function in the :doc:`Encryption Library <libraries/encryption>`.
- Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library <libraries/security>`, which makes token regeneration optional.


- Core

- Changed private functions in CI_URI to protected so MY_URI can override them.
- Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions).
- Added method get_vars() to CI_Loader to retrieve all variables loaded with $this->load->vars().
- is_loaded() function from system/core/Commons.php now returns a reference.

Bug fixes for 3.0
------------------
Expand All @@ -96,7 +96,7 @@ Bug fixes for 3.0
- Fixed a bug in CI_Image_lib::gd_loaded() where it was possible for the script execution to end or a PHP E_WARNING message to be emitted.
- In Pagination library, when use_page_numbers=TRUE previous link and page 1 link do not have the same url
- Fixed a bug (#561) - Errors in :doc:`XML-RPC Library <libraries/xmlrpc>` were not properly escaped.

- Fixed a bug (#904) - ``CI_Loader::initialize()`` caused a PHP Fatal error to be triggered if error level E_STRICT is used.

Version 2.1.0
=============
Expand Down

1 comment on commit b790371

@richwestcoast
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey good work :)

Please sign in to comment.