few minor cleanups to last commit
This commit is contained in:
@@ -526,13 +526,14 @@ class MeekroDB {
|
|||||||
else return $this->escape($value);
|
else return $this->escape($value);
|
||||||
|
|
||||||
} else if ($type == 'list') {
|
} else if ($type == 'list') {
|
||||||
if (is_array($value) && array_values($value) === $value) {
|
if (is_array($value)) {
|
||||||
|
$value = array_values($value);
|
||||||
return '(' . implode(', ', array_map(array($this, 'sanitize'), $value)) . ')';
|
return '(' . implode(', ', array_map(array($this, 'sanitize'), $value)) . ')';
|
||||||
} else {
|
} else {
|
||||||
return $this->nonSQLError("Expected array parameter, got something different!");
|
return $this->nonSQLError("Expected array parameter, got something different!");
|
||||||
}
|
}
|
||||||
} else if ($type == 'doublelist') {
|
} else if ($type == 'doublelist') {
|
||||||
if (is_array($value) && array_values($value) === $value && is_array($value[0])) {
|
if (is_array($value) && array_values($value) === $value && is_array($value[0])) {
|
||||||
$cleanvalues = array();
|
$cleanvalues = array();
|
||||||
foreach ($value as $subvalue) {
|
foreach ($value as $subvalue) {
|
||||||
$cleanvalues[] = $this->sanitize($subvalue, 'list');
|
$cleanvalues[] = $this->sanitize($subvalue, 'list');
|
||||||
@@ -543,7 +544,7 @@ class MeekroDB {
|
|||||||
return $this->nonSQLError("Expected double array parameter, got something different!");
|
return $this->nonSQLError("Expected double array parameter, got something different!");
|
||||||
}
|
}
|
||||||
} else if ($type == 'hash') {
|
} else if ($type == 'hash') {
|
||||||
if (is_array($value) && array_values($value) !== $value) {
|
if (is_array($value)) {
|
||||||
$pairs = array();
|
$pairs = array();
|
||||||
foreach ($value as $k => $v) {
|
foreach ($value as $k => $v) {
|
||||||
$pairs[] = $this->formatTableName($k) . '=' . $this->sanitize($v);
|
$pairs[] = $this->formatTableName($k) . '=' . $this->sanitize($v);
|
||||||
|
|||||||
Reference in New Issue
Block a user