mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-13 16:34:52 +09:00
SQL injection defense
git-svn-id: http://xe-core.googlecode.com/svn/trunk@10372 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
092d7988ba
commit
064fa452e5
3 changed files with 57 additions and 4 deletions
|
|
@ -66,12 +66,14 @@
|
|||
}
|
||||
|
||||
function escapeValue($value){
|
||||
if($this->getType() == 'column_name'){
|
||||
$column_type = $this->getType();
|
||||
if($column_type == 'column_name'){
|
||||
$dbParser = DB::getParser();
|
||||
return $dbParser->parseExpression($value);
|
||||
}
|
||||
if(!isset($value)) return null;
|
||||
if(in_array($this->getType(), array('date', 'varchar', 'char','text', 'bigtext'))){
|
||||
}
|
||||
if(!isset($value)) return null;
|
||||
|
||||
if(in_array($column_type, array('date', 'varchar', 'char','text', 'bigtext'))){
|
||||
if(!is_array($value))
|
||||
$value = $this->_escapeStringValue ($value);
|
||||
else {
|
||||
|
|
@ -81,6 +83,9 @@
|
|||
//$value[$i] = '\''.$value[$i].'\'';
|
||||
}
|
||||
}
|
||||
if($column_type == 'number')
|
||||
$value = (int)$value;
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue