1
0
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:
David Grudl
2009-04-16 02:15:20 +00:00
parent 496c224be5
commit 6589519419
8 changed files with 12 additions and 43 deletions

View File

@@ -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';
}
}