2011-05-12 Miguel de Dios <miguel.dedios@artica.es>
* include/db/postgresql.php, include/db/mysql.php: fixed the scape of name of fields in where. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4346 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e43c80a306
commit
9f3c87253e
|
@ -1,3 +1,8 @@
|
|||
2011-05-12 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/db/postgresql.php, include/db/mysql.php: fixed the scape of name
|
||||
of fields in where.
|
||||
|
||||
2011-05-12 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_graph.php: fixed the image parameters for the progress
|
||||
|
|
|
@ -503,7 +503,9 @@ function mysql_db_format_array_where_clause_sql ($values, $join = 'AND', $prefix
|
|||
}
|
||||
|
||||
if ($field[0] != "`") {
|
||||
$field = "`".$field."`";
|
||||
//If the field is as <table>.<field>, don't scape.
|
||||
if (strstr($field, '.') === false)
|
||||
$field = "`".$field."`";
|
||||
}
|
||||
|
||||
if (is_null ($value)) {
|
||||
|
@ -668,7 +670,7 @@ function mysql_db_get_all_rows_filter ($table, $filter = array(), $fields = fals
|
|||
elseif (! is_string ($fields)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//TODO: Validate and clean filter options
|
||||
if (is_array ($filter)) {
|
||||
$filter = db_format_array_where_clause_sql ($filter, $where_join, ' WHERE ');
|
||||
|
|
|
@ -540,7 +540,9 @@ function postgresql_db_format_array_where_clause_sql ($values, $join = 'AND', $p
|
|||
}
|
||||
|
||||
if ($field[0] != "\"") {
|
||||
$field = "\"".$field."\"";
|
||||
//If the field is as <table>.<field>, don't scape.
|
||||
if (strstr($field, '.') === false)
|
||||
$field = "\"".$field."\"";
|
||||
}
|
||||
|
||||
if (is_null ($value)) {
|
||||
|
|
Loading…
Reference in New Issue