1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-14 10:05:44 +02:00

rewritten dibi::IDENTIFIER escaping; added support for [table.*]

This commit is contained in:
David Grudl
2010-05-19 14:53:19 +02:00
parent 27930611de
commit bec559448c
11 changed files with 20 additions and 37 deletions

View File

@@ -564,14 +564,15 @@ final class DibiTranslator extends DibiObject
*/
private function delimite($value)
{
if ($value === '*') {
return '*';
} elseif (strpos($value, ':') !== FALSE) { // provide substitution
if (strpos($value, ':') !== FALSE) { // provide substitution
$value = preg_replace_callback('#:([^:\s]*):#', array(__CLASS__, 'subCb'), $value);
}
return $this->driver->escape($value, dibi::IDENTIFIER);
$parts = explode('.', $value);
foreach ($parts as & $value) {
$value = $value === '*' ? '*' : $this->driver->escape($value, dibi::IDENTIFIER);
}
return implode('.', $parts);
}