Index: trunk/core/install.php =================================================================== diff -u -N -r8078 -r8397 --- trunk/core/install.php (.../install.php) (revision 8078) +++ trunk/core/install.php (.../install.php) (revision 8397) @@ -434,13 +434,13 @@ // get only sqls from next (relative to current) version to end of file $start_pos = strpos($sqls, $version_mark); $sqls = substr($sqls, $start_pos); - + preg_match_all('/'.VERSION_MARK.'/s', $sqls, $regs); - + $this->RunUpgrades($module_info['Path'], $regs[1], 'before'); $this->RunSQLText($sqls); $this->RunUpgrades($module_info['Path'], $regs[1], 'after'); - + // after upgrade sqls are executed update version $this->SetModuleVersion($module_name, $module_info['ToVersion']); } @@ -493,32 +493,32 @@ function RunUpgrades($module_path, $versions, $mode) { static $upgrade_classes = Array (); - + $upgrades_file = sprintf(UPGRADES_FILE, $module_path, 'php'); if (!file_exists($upgrades_file) || !$versions) { return ; } - + if (!isset($upgrade_classes[$module_path])) { // save class name, because 2nd time // (in after call $upgrade_class variable will not be present) include_once $upgrades_file; $upgrade_classes[$module_path] = $upgrade_class; } - + $upgrade_object = new $upgrade_classes[$module_path](); if (method_exists($upgrade_object, 'setInstallator')) { $upgrade_object->setInstallator($this); } - + foreach ($versions as $version) { $upgrade_method = 'Upgrade_'.str_replace('.', '_', $version); if (method_exists($upgrade_object, $upgrade_method)) { $upgrade_object->$upgrade_method($mode); } } } - + /** * Sets module version to passed * @@ -763,7 +763,7 @@ } $sqls = str_replace("\r\n", "\n", $sqls); // convert to linux line endings - $sqls = preg_replace("/#(.*?)\n/", '', $sqls); // remove all comments + $sqls = preg_replace("/#([^;]*?)\n/", '', $sqls); // remove all comments $sqls = explode(";\n", $sqls); foreach ($sqls as $sql) {