mirror of
https://github.com/dg/dibi.git
synced 2025-08-27 15:59:49 +02:00
- DibiTranslator: empty arrays generate NULL (it may cause an BC break!)
- Dibi: disables magic_quotes_runtime
This commit is contained in:
@@ -260,7 +260,7 @@ final class DibiTranslator extends DibiObject
|
||||
$pair = explode('%', $k, 2); // split into identifier & modifier
|
||||
$vx[] = $this->formatValue($v, isset($pair[1]) ? $pair[1] : FALSE);
|
||||
}
|
||||
return '(' . implode(', ', $vx) . ')';
|
||||
return '(' . ($vx ? implode(', ', $vx) : 'NULL') . ')';
|
||||
|
||||
|
||||
case 'v': // (key, key, ...) VALUES (val, val, ...)
|
||||
@@ -291,7 +291,7 @@ final class DibiTranslator extends DibiObject
|
||||
foreach ($value as $v) {
|
||||
$vx[] = $this->formatValue($v, $modifier);
|
||||
}
|
||||
return implode(', ', $vx);
|
||||
return $vx ? implode(', ', $vx) : 'NULL';
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user