summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsystem/core/CodeIgniter.php2
-rw-r--r--system/core/Common.php2
-rwxr-xr-xsystem/core/Lang.php2
-rwxr-xr-xsystem/core/Output.php9
-rwxr-xr-xsystem/core/URI.php5
-rw-r--r--system/database/DB_active_rec.php5
-rw-r--r--system/helpers/file_helper.php14
7 files changed, 18 insertions, 21 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index cb5d439bd..7af3c485d 100755
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -267,7 +267,7 @@
$method = $RTR->fetch_method();
if ( ! class_exists($class)
- OR strpos($method, '_', 1) === 0
+ OR strpos($method, '_') === 0
OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller')))
)
{
diff --git a/system/core/Common.php b/system/core/Common.php
index 6ef229629..1f59c02d7 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -235,7 +235,7 @@ if ( ! function_exists('get_config'))
}
// Is the config file in the environment folder?
- if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT..'/config.php'))
+ if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
{
$file_path = APPPATH.'config/config.php';
}
diff --git a/system/core/Lang.php b/system/core/Lang.php
index 088cb6c9c..c40a6856e 100755
--- a/system/core/Lang.php
+++ b/system/core/Lang.php
@@ -130,7 +130,7 @@ class CI_Lang {
}
$this->is_loaded[] = $langfile;
- $this->language = $this->language + $lang;
+ $this->language = array_merge($this->language, $lang);
unset($lang);
log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile);
diff --git a/system/core/Output.php b/system/core/Output.php
index 1beee734f..abd8a0ea9 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -129,7 +129,6 @@ class CI_Output {
*
* Sets the output string
*
- * @access public
* @param string
* @return void
*/
@@ -282,7 +281,7 @@ class CI_Output {
* @param integer
* @return void
*/
- publi function cache($time)
+ public function cache($time)
{
$this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time;
return $this;
@@ -397,15 +396,13 @@ class CI_Output {
// If the output data contains closing </body> and </html> tags
// we will remove them and add them back after we insert the profile data
- $output = preg_replace('|</body>.*?</html>|is', '', $output, $count).$CI->profiler->run();
+ $output = preg_replace('|</body>.*?</html>|is', '', $output, -1, $count).$CI->profiler->run();
if ($count > 0)
{
$output .= '</body></html>';
}
}
- // --------------------------------------------------------------------
-
// Does the controller contain a function named _output()?
// If so send the output there. Otherwise, echo it.
if (method_exists($CI, '_output'))
@@ -414,7 +411,7 @@ class CI_Output {
}
else
{
- echo $output; // Send it to the browser!
+ echo $output; // Send it to the browser!
}
log_message('debug', 'Final output sent to browser');
diff --git a/system/core/URI.php b/system/core/URI.php
index eaf7b752b..b28ee198b 100755
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -186,11 +186,12 @@ class CI_URI {
return '';
}
- if (strpos($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']) === 0)
+ $uri = $_SERVER['REQUEST_URI'];
+ if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0)
{
$uri = substr($uri, strlen($_SERVER['SCRIPT_NAME']));
}
- elseif (strpos($_SERVER['REQUEST_URI'], dirname($_SERVER['SCRIPT_NAME'])) === 0)
+ elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
{
$uri = substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME'])));
}
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 71762a4de..424735157 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1127,15 +1127,14 @@ class CI_DB_active_record extends CI_DB_driver {
$result = $this->query($this->_compile_select($this->_count_string.$this->_protect_identifiers('numrows')));
$this->_reset_select();
- if ($query->num_rows() === 0)
+ if ($result->num_rows() === 0)
{
return 0;
}
- $row = $query->row();
+ $row = $result->row();
return (int) $row->numrows;
}
-
// --------------------------------------------------------------------
/**
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 9b39b8c20..2d4b10e37 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -196,16 +196,16 @@ if ( ! function_exists('get_filenames'))
while (FALSE !== ($file = readdir($fp)))
{
- if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0)
+ if (@is_dir($source_dir.$file) && $file[0] !== '.')
{
get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE);
}
- elseif (strncmp($file, '.', 1) !== 0)
+ elseif ($file[0] !== '.')
{
$_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file;
}
}
- closedir($source_dir);
+ closedir($fp);
return $_filedata;
}
@@ -249,17 +249,17 @@ if ( ! function_exists('get_dir_file_info'))
// foreach (scandir($source_dir, 1) as $file) // In addition to being PHP5+, scandir() is simply not as fast
while (FALSE !== ($file = readdir($fp)))
{
- if (@is_dir($source_dir.$file) AND strncmp($file, '.', 1) !== 0 AND $top_level_only === FALSE)
+ if (@is_dir($source_dir.$file) && $file[0] !== '.' && $top_level_only === FALSE)
{
get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, TRUE);
}
- elseif (strncmp($file, '.', 1) !== 0)
+ elseif ($file[0] !== '.')
{
$_filedata[$file] = get_file_info($source_dir.$file);
$_filedata[$file]['relative_path'] = $relative_path;
}
}
- closedir($source_dir);
+ closedir($fp);
return $_filedata;
}
@@ -359,7 +359,7 @@ if ( ! function_exists('get_mime_by_extension'))
if ( ! is_array($mimes))
{
- if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
+ if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
{
include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
}