Browse Source

Fix for PHP 7.3

The PHP7.3 was not handling the single line regex
ahwelp 6 years ago
parent
commit
e7d986095c
1 changed files with 2 additions and 1 deletions
  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') {