diff options
author | Andrey Andreev <narf@bofh.bg> | 2013-02-15 21:13:53 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2013-02-15 21:13:53 +0100 |
commit | 73abf95a507879d3893d933cc769e11275dbad75 (patch) | |
tree | 338d0a3322bc84268e99323131ff43b4620fee79 /system/core/Log.php | |
parent | 3ba26413f3fabe64f77f936a357845d118f950f5 (diff) | |
parent | 62f7cdf3a6f5d701430267ef9ba9bfd92650deab (diff) |
Merge pull request #2243 from chrispassas/develop
Update system/core/Log.php
Diffstat (limited to 'system/core/Log.php')
-rw-r--r-- | system/core/Log.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/system/core/Log.php b/system/core/Log.php index f5d091e14..0749de8ba 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -97,6 +97,8 @@ class CI_Log { $this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/'; + $this->_log_ext = ($config['log_file_extension'] !== '') ? ltrim($config['log_file_extension'], '.') : $this->_log_ext; + file_exists($this->_log_path) OR mkdir($this->_log_path, DIR_WRITE_MODE, TRUE); if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path)) @@ -153,7 +155,10 @@ class CI_Log { if ( ! file_exists($filepath)) { $newfile = TRUE; - $message .= '<'."?php defined('BASEPATH') OR exit('No direct script access allowed'); ?".">\n\n"; + if($this->_log_ext === 'php') + { + $message .= '<'."?php defined('BASEPATH') OR exit('No direct script access allowed'); ?".">\n\n"; + } } if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) |