Explorar o código

Fix for PHP 7.3

The PHP7.3 was not handling the single line regex
ahwelp %!s(int64=6) %!d(string=hai) anos
pai
achega
e7d986095c
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/ORM/DBInstance.php

+ 2 - 1
src/ORM/DBInstance.php

@@ -6,8 +6,9 @@ class DBInstance {
 
     private static function addPrefix($sql, $instance = 'default'){
         $con = Connections::getConnection($instance);
+      	$sql =  preg_replace('/{(.*)}/', "$con->prefix$1", $sql);
       	$sql =  preg_replace( "/\r|\n/", "", $sql );
-        return  preg_replace('/{(.*)}/', "$con->prefix$1", $sql);
+        return  $sql;
     }
     
     public static function execute($sql, $data = null, $instance = 'default') {