|
@@ -79,11 +79,8 @@ class FullTransformer
|
|
{
|
|
{
|
|
$length = strlen($dateChars);
|
|
$length = strlen($dateChars);
|
|
|
|
|
|
- if ("'" === $dateChars[0]) {
|
|
|
|
- if (preg_match("/^'+$/", $dateChars)) {
|
|
|
|
- return str_replace("''", "'", $dateChars);
|
|
|
|
- }
|
|
|
|
- return str_replace("''", "'", substr($dateChars, 1, -1));
|
|
|
|
|
|
+ if ($this->isQuoteMatch($dateChars)) {
|
|
|
|
+ return $this->replaceQuoteMatch($dateChars);
|
|
}
|
|
}
|
|
|
|
|
|
if (isset($this->transformers[$dateChars[0]])) {
|
|
if (isset($this->transformers[$dateChars[0]])) {
|
|
@@ -107,6 +104,11 @@ class FullTransformer
|
|
$length = strlen($matches[0]);
|
|
$length = strlen($matches[0]);
|
|
$transformerIndex = $matches[0][0];
|
|
$transformerIndex = $matches[0][0];
|
|
|
|
|
|
|
|
+ $dateChars = $matches[0];
|
|
|
|
+ if ($that->isQuoteMatch($dateChars)) {
|
|
|
|
+ return $that->replaceQuoteMatch($dateChars);
|
|
|
|
+ }
|
|
|
|
+
|
|
$transformers = $that->getTransformers();
|
|
$transformers = $that->getTransformers();
|
|
|
|
|
|
if (isset($transformers[$transformerIndex])) {
|
|
if (isset($transformers[$transformerIndex])) {
|
|
@@ -171,6 +173,19 @@ class FullTransformer
|
|
return $ret;
|
|
return $ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function isQuoteMatch($quoteMatch)
|
|
|
|
+ {
|
|
|
|
+ return ("'" === $quoteMatch[0]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function replaceQuoteMatch($quoteMatch)
|
|
|
|
+ {
|
|
|
|
+ if (preg_match("/^'+$/", $quoteMatch)) {
|
|
|
|
+ return str_replace("''", "'", $quoteMatch);
|
|
|
|
+ }
|
|
|
|
+ return str_replace("''", "'", substr($quoteMatch, 1, -1));
|
|
|
|
+ }
|
|
|
|
+
|
|
private function calculateUnixTimestamp($dateTime, array $options)
|
|
private function calculateUnixTimestamp($dateTime, array $options)
|
|
{
|
|
{
|
|
$datetime = $this->extractDateTime($options);
|
|
$datetime = $this->extractDateTime($options);
|