Explorar o código

Changing prefixing substitution method

ahwelp %!s(int64=2) %!d(string=hai) anos
pai
achega
edf7974a4f
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/Schema/Wrapper.php

+ 3 - 1
src/Schema/Wrapper.php

@@ -86,7 +86,9 @@ class Wrapper
     {
         $instance = self::getInstance();
         $prefix = $instance->_adapter->getConnection()->prefix;
-        $sql = preg_replace('/{.*?}/', "$prefix$1", $sql);
+        $sql = preg_replace_callback('/{.*?}/', function($match) use ($prefix){
+            return str_replace('}', '', str_replace('{', $prefix, $match[0]));
+        } , $sql);
         $instance->_driver->exec($sql);
     }