1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-08 15:16:58 +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 43f5e08296
commit f51ac0b67e
3 changed files with 3 additions and 3 deletions

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);