Преглед изворни кода

Changing prefixing substitution method

ahwelp пре 2 година
родитељ
комит
edf7974a4f
1 измењених фајлова са 3 додато и 1 уклоњено
  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);
     }