diff --git a/litemysql.lib.php b/litemysql.lib.php index 4dbea93..c49f393 100644 --- a/litemysql.lib.php +++ b/litemysql.lib.php @@ -633,7 +633,7 @@ class LiteMySQL { } elseif ( preg_match('/^[0-9]+$/', $value) ) { $cond[] = "`id` = '".$value."'"; } else { - $cond[] = $value; + $cond[] = $this->sql_quote($value); } } $operator = ( !empty($options['operator']) ) ? $options['operator'] : 'AND' ; @@ -694,6 +694,8 @@ class LiteMySQL { } if ( ($column == 'integer' || $column == 'float') && preg_match('/^[0-9\-\.]+$/', $string) ) { return $string; + } elseif ( preg_match('/^[0-9\-\.]+$/', $string) ) { + return $string; } else { return "'".addslashes($string)."'"; }