1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 22:26:43 +02:00

fixed invalid escaping sequences in double quoted strings, used \z instead of $

This commit is contained in:
David Grudl
2012-10-18 22:06:19 +02:00
parent 7696fc36e1
commit b4de8daed3
3 changed files with 3 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ class DibiSqliteReflector extends DibiObject implements IDibiReflector
$columns = array();
while ($row = $res->fetch(TRUE)) {
$column = $row['name'];
$pattern = "/(\"$column\"|\[$column\]|$column)\s+[^,]+\s+PRIMARY\s+KEY\s+AUTOINCREMENT/Ui";
$pattern = "/(\"$column\"|\[$column\]|$column)\\s+[^,]+\\s+PRIMARY\\s+KEY\\s+AUTOINCREMENT/Ui";
$type = explode('(', $row['type']);
$columns[] = array(
'name' => $column,

View File

@@ -181,7 +181,7 @@ class DibiFluent extends DibiObject implements IDataSource
if ($arg === TRUE) { // flag
return $this;
} elseif (is_string($arg) && preg_match('#^[a-z:_][a-z0-9_.:]*$#i', $arg)) { // identifier
} elseif (is_string($arg) && preg_match('#^[a-z:_][a-z0-9_.:]*\z#i', $arg)) { // identifier
$args = array('%n', $arg);
} elseif (is_array($arg) || ($arg instanceof Traversable && !$arg instanceof self)) { // any array

View File

@@ -353,7 +353,7 @@ final class DibiTranslator extends DibiObject
case 'i': // signed int
case 'u': // unsigned int, ignored
// support for long numbers - keep them unchanged
if (is_string($value) && preg_match('#[+-]?\d++(e\d+)?$#A', $value)) {
if (is_string($value) && preg_match('#[+-]?\d++(e\d+)?\z#A', $value)) {
return $value;
} else {
return $value === NULL ? 'NULL' : (string) (int) ($value + 0);