mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-24 13:49:56 +09:00
#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:
parent
23ddda10c6
commit
9076974a59
1 changed files with 5 additions and 13 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue