mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
Added support for addQuotes - escpaes special charcters in query arguments.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8585 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
652cc1549a
commit
54ef159878
2 changed files with 10 additions and 3 deletions
|
|
@ -50,16 +50,24 @@
|
|||
if(!isset($value) || $value === '') return null;
|
||||
if(in_array($this->type, array('date', 'varchar', 'char','text', 'bigtext'))){
|
||||
if(!is_array($value))
|
||||
$value = '\''.$value.'\'';
|
||||
$value = $this->_escapeStringValue ($value);
|
||||
else {
|
||||
$total = count($value);
|
||||
for($i = 0; $i < $total; $i++)
|
||||
$value[$i] = '\''.$value[$i].'\'';
|
||||
$value[$i] = $this->_escapeStringValue($value[$i]);
|
||||
//$value[$i] = '\''.$value[$i].'\'';
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function _escapeStringValue($value){
|
||||
$db = &DB::getInstance();
|
||||
$value = $db->addQuotes($value);
|
||||
return '\''.$value.'\'';
|
||||
|
||||
}
|
||||
|
||||
function isValid(){
|
||||
return $this->isValid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue