diff options
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/DB_active_rec.php | 3 | ||||
-rw-r--r-- | system/database/drivers/oci8/oci8_driver.php | 14 | ||||
-rw-r--r-- | system/database/drivers/odbc/odbc_result.php | 9 |
3 files changed, 12 insertions, 14 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 424735157..eaae23f30 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -236,7 +236,8 @@ class CI_DB_active_record extends CI_DB_driver { { if (strpos($item, '.') !== FALSE) { - return end(explode('.', $item)); + $item = explode('.', $item); + return end($item); } return $item; diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index c6621901b..057095c23 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -398,10 +398,9 @@ class CI_DB_oci8_driver extends CI_DB { /** * Escape String * - * @access public - * @param string + * @param string * @param bool whether or not the string will be used in a LIKE condition - * @return string + * @return string */ public function escape_str($str, $like = FALSE) { @@ -415,15 +414,14 @@ class CI_DB_oci8_driver extends CI_DB { return $str; } - $str = remove_invisible_characters($str); - $str = str_replace("'", "''", $str); + $str = str_replace("'", "''", remove_invisible_characters($str)); // escape LIKE condition wildcards if ($like === TRUE) { - $str = str_replace( array('%', '_', $this->_like_escape_chr), - array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), - $str); + return str_replace(array($this->_like_escape_chr, '%', '_'), + array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), + $str); } return $str; diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index e7cbc7af5..db3576d35 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -78,19 +78,18 @@ class CI_DB_odbc_result extends CI_DB_result { */ public function list_fields() { + $field_names = array(); $num_fields = $this->num_fields(); + if ($num_fields > 0) { - $field_names = array(); for ($i = 1; $i <= $num_fields; $i++) { - $field_names[] = odbc_field_name($this->result_id, $i); + $field_names[] = odbc_field_name($this->result_id, $i); } - - return $field_names; } - return array(); + return $field_names; } // -------------------------------------------------------------------- |