From 2e5eac5627fb6611b6a04750edee0251cb16b8b7 Mon Sep 17 00:00:00 2001 From: Giovanni Gargani Date: Sat, 10 Sep 2016 00:36:09 +0200 Subject: [PATCH] CRM-18199 CRM_Utils_File::sourceSQLFile too greedy Refactored the 2 comemnt stripping regexp in just one and fixed the greedyness --- CRM/Utils/File.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 485280bd74..64528a3855 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -324,8 +324,7 @@ class CRM_Utils_File { // get rid of comments starting with # and -- - $string = preg_replace("/^#[^\n]*$/m", "\n", $string); - $string = preg_replace("/^(--[^-]).*/m", "\n", $string); + $string = preg_replace("/^(#|--)[^\R]*$/m", "", $string); $queries = preg_split('/;\s*$/m', $string); foreach ($queries as $query) { -- 2.25.1