diff --git a/src/Core.php b/src/Core.php index 8f22201..69903e4 100644 --- a/src/Core.php +++ b/src/Core.php @@ -56,7 +56,7 @@ class Core dcCore::app()->callBehavior('improveAddAction', $list); foreach ($list as $action) { - if ($action instanceof Action && !isset($this->actions[$action->id()])) { + if (($action instanceof Action) && !isset($this->actions[$action->id()])) { if (in_array($action->id(), $disabled)) { $this->disabled[$action->id()] = $action->name(); } else { @@ -95,12 +95,11 @@ class Core if (empty($this->logs)) { return 0; } - $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcLog::LOG_TABLE_NAME); - $cur->log_msg = json_encode($this->logs); - $cur->log_table = My::id(); - $id = dcCore::app()->log->addLog($cur); + $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcLog::LOG_TABLE_NAME); + $cur->setField('log_msg', json_encode($this->logs)); + $cur->setField('log_table', My::id()); - return $id; + return dcCore::app()->log->addLog($cur); } public function readLogs(int $id): array diff --git a/src/Install.php b/src/Install.php index cdf542d..2ac5887 100644 --- a/src/Install.php +++ b/src/Install.php @@ -97,18 +97,18 @@ class Install extends dcNsProcess foreach (['setting_', 'preferences'] as $key) { $record = dcCore::app()->con->select( 'SELECT * FROM ' . dcCore::app()->prefix . dcNamespace::NS_TABLE_NAME . ' ' . - "WHERE setting_ns = '" . dcCore::app()->con->escape(My::id()) . "' " . + "WHERE setting_ns = '" . dcCore::app()->con->escapeStr(My::id()) . "' " . "AND setting_id LIKE '" . $key . "%' " ); while ($record->fetch()) { try { - $value = @unserialize($record->f('setting_value')); - $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcNamespace::NS_TABLE_NAME); - $cur->setting_value = json_encode(is_array($value) ? $value : []); + $value = @unserialize($record->f('setting_value')); + $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcNamespace::NS_TABLE_NAME); + $cur->setField('setting_value', json_encode(is_array($value) ? $value : [])); $cur->update( - "WHERE setting_id = '" . $record->f('setting_id') . "' and setting_ns = '" . dcCore::app()->con->escape($record->f('setting_ns')) . "' " . - 'AND blog_id ' . (null === $record->f('blog_id') ? 'IS NULL ' : ("= '" . dcCore::app()->con->escape($record->f('blog_id')) . "' ")) + "WHERE setting_id = '" . $record->f('setting_id') . "' and setting_ns = '" . dcCore::app()->con->escapeStr($record->f('setting_ns')) . "' " . + 'AND blog_id ' . (null === $record->f('blog_id') ? 'IS NULL ' : ("= '" . dcCore::app()->con->escapeStr($record->f('blog_id')) . "' ")) ); } catch(Exception) { } diff --git a/src/module/zip.php b/src/module/zip.php index 8288c55..cc5924e 100644 --- a/src/module/zip.php +++ b/src/module/zip.php @@ -218,7 +218,7 @@ class zip extends Action $zip->addExclusion($e); } $zip->addDirectory( - Path::real($this->module->get('root')), + (string) Path::real($this->module->get('root')), $this->module->getId(), true );