Explorar el Código

Changing prefixing substitution method

ahwelp hace 2 años
padre
commit
edf7974a4f
Se han modificado 1 ficheros con 3 adiciones y 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);
     }