Skip to content

Commit

Permalink
Fixed issue #16347: Error while updating database using console command
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Mar 1, 2021
1 parent d439ff8 commit 7cc9413
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions application/commands/UpdateDbCommand.php
Expand Up @@ -41,6 +41,7 @@ public function run($args = null)
echo Yii::app()->db->tablePrefix . " from {$currentDbVersion} to {$newDbVersion}\n";
Yii::import('application.helpers.common_helper', true);
Yii::import('application.helpers.update.updatedb_helper', true);
Yii::import('application.helpers.update.update_helper', true);
$result = db_upgrade_all($currentDbVersion);
if ($result) {
echo "Database has been successfully upgraded to version $newDbVersion \n";
Expand Down
2 changes: 1 addition & 1 deletion application/core/LSYii_Validators.php
Expand Up @@ -50,7 +50,7 @@ public function __construct()
// Permission::model exist only after 172 DB version
return $this->xssfilter = ($this->xssfilter && Yii::app()->getConfig('filterxsshtml'));
}
$this->xssfilter = ($this->xssfilter && Yii::app()->user->isXssFiltered());
$this->xssfilter = ($this->xssfilter && (get_class($controller) !== 'ConsoleApplication' ) && Yii::app()->user->isXssFiltered());
return;
}

Expand Down

1 comment on commit 7cc9413

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using if (Yii::app() instanceof CConsoleApplication) { elsewhere (Permission for example)

Please sign in to comment.