From efe859a1750c47fd3f0b4ed8c35767aecb858a1a Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 2 Oct 2013 21:33:03 +0000 Subject: [PATCH] Allow semicolons in single quotes in schema files --- include/class.setup.php | 4 +++- include/upgrader/streams/core/d51f303a-ec19794f.patch.sql | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/class.setup.php b/include/class.setup.php index d2c16cb10..f281da61b 100644 --- a/include/class.setup.php +++ b/include/class.setup.php @@ -52,7 +52,9 @@ Class SetupWizard { # Replace table prefix $schema = str_replace('%TABLE_PREFIX%', $prefix, $schema); # Split by semicolons - and cleanup - if(!($statements = array_filter(array_map('trim', @explode(';', $schema))))) + if(!($statements = array_filter(array_map('trim', + // Thanks, http://stackoverflow.com/a/3147901 + preg_split("/;(?=(?:[^']*'[^']*')*[^']*$)/", $schema))))) return $this->abort('Error parsing SQL schema', $debug); diff --git a/include/upgrader/streams/core/d51f303a-ec19794f.patch.sql b/include/upgrader/streams/core/d51f303a-ec19794f.patch.sql index 52449d9aa..887ae1b69 100644 --- a/include/upgrader/streams/core/d51f303a-ec19794f.patch.sql +++ b/include/upgrader/streams/core/d51f303a-ec19794f.patch.sql @@ -1,6 +1,6 @@ /** * @signature ec19794f1fc8d6a54ac217d6e8006a85 - * @version 1.8.0 + * @version 1.8.0 - HTML ticket thread * * Migrate to a single attachment table to allow for inline image support * with an almost countless number of attachment tables to support what is -- GitLab