#19690852 Refactoring: updated addQuotes to check if magic quotes are on only once and not on every function call.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8310 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
mosmartin 2011-04-13 15:41:26 +00:00
parent 23ddda10c6
commit 9076974a59

View file

@ -22,7 +22,8 @@
var $prefix = 'xe'; // / <prefix of XE tables(One more XE can be installed on a single DB)
var $cutlen = 12000; // /< max size of constant in CUBRID(if string is larger than this, '...'+'...' should be used)
var $comment_syntax = '/* %s */';
var $magic_quotes_enabled = false;
/**
* @brief column type used in CUBRID
*
@ -81,6 +82,7 @@
$this->prefix = $db_info->db_table_prefix;
if (!substr($this->prefix, -1) != '_') $this->prefix .= '_';
$this->magic_quotes_enabled = (version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc());
}
/**
@ -123,21 +125,11 @@
{
if (!$this->fd) return $string;
if (version_compare (PHP_VERSION, "5.9.0", "<") &&
get_magic_quotes_gpc ()) {
if ($this->magic_quotes_enabled) {
$string = stripslashes (str_replace ("\\","\\\\", $string));
}
if (!is_numeric ($string)) {
/*
if ($this->isConnected()) {
$string = cubrid_real_escape_string($string);
}
else {
$string = str_replace("'","\'",$string);
}
*/
if (!is_numeric($string)) {
$string = str_replace("'","''",$string);
}