diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/codeigniter/Common.php | 6 | ||||
-rw-r--r-- | system/drivers/DB_active_record.php | 2 | ||||
-rw-r--r-- | system/drivers/DB_driver.php | 10 | ||||
-rw-r--r-- | system/helpers/form_helper.php | 4 | ||||
-rw-r--r-- | system/libraries/Log.php | 2 |
5 files changed, 13 insertions, 11 deletions
diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 4879e7099..d5bec77fe 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -153,8 +153,10 @@ function show_404($page = '') * @access public * @return void */ -function log_message($level = 2, $message, $php_error = FALSE) +function log_message($level = 'error', $message, $php_error = FALSE) { + static $LOG; + $config =& _get_config(); if ($config['log_errors'] === FALSE) { @@ -166,7 +168,7 @@ function log_message($level = 2, $message, $php_error = FALSE) include_once(BASEPATH.'libraries/Log.php'); } - if ( ! isset($LOG)) + if ( ! is_object($LOG)) { $LOG = new CI_Log( $config['log_path'], diff --git a/system/drivers/DB_active_record.php b/system/drivers/DB_active_record.php index 373c0f626..f1995c807 100644 --- a/system/drivers/DB_active_record.php +++ b/system/drivers/DB_active_record.php @@ -663,7 +663,7 @@ class CI_DB_active_record extends CI_DB_driver { if (count($this->ar_where) == 0) { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_del_must_use_where'); } diff --git a/system/drivers/DB_driver.php b/system/drivers/DB_driver.php index ed18d54e5..3a2a5e9bc 100644 --- a/system/drivers/DB_driver.php +++ b/system/drivers/DB_driver.php @@ -86,7 +86,7 @@ class CI_DB_driver { { log_message('error', 'Invalid DB Connection String'); - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_invalid_connection_str'); } @@ -265,7 +265,7 @@ class CI_DB_driver { if ( ! function_exists($function)) { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_unsupported_function'); } @@ -425,7 +425,7 @@ class CI_DB_driver { { if ($table == '') { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_field_param_missing'); } @@ -472,7 +472,7 @@ class CI_DB_driver { { if ($table == '') { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_field_param_missing'); } @@ -535,7 +535,7 @@ class CI_DB_driver { // Just in case the replacement string contains the bind // character we'll temporarily replace it with a marker $val = str_replace($this->bind_marker, '{%bind_marker%}', $val); - $sql = preg_replace("#".preg_quote($this->bind_marker)."#", $val, $sql, 1); + $sql = preg_replace("#".preg_quote($this->bind_marker, '#')."#", str_replace('$', '\$', $val), $sql, 1); } return str_replace('{%bind_marker%}', $this->bind_marker, $sql); diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 069101063..eb97913f1 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -247,7 +247,7 @@ function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') { $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - if (isset($data['checked'])) + if (is_array($data) AND array_key_exists('checked', $data)) { $checked = $data['checked']; @@ -256,7 +256,7 @@ function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') } if ($checked == TRUE) - $defaults['checked'] = ' checked="checked"'; + $defaults['checked'] = 'checked'; else unset($defaults['checked']); diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 17b96b2c2..de5a9b836 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -40,7 +40,7 @@ class CI_Log { * @param string the error threshold * @param string the date formatting codes */ - function CI_Log($path = '', $threshold = '', $date_fmt = '') + function CI_Log($path = '', $threshold = 4, $date_fmt = '') { $this->log_path = ($path != '') ? $path : BASEPATH.'logs/'; |