Skip to content

Commit

Permalink
Fix undefined global variable $_SESSION in a CLI connector (#16425)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Jakobi <thomas.jakobi@partout.info>
  • Loading branch information
opengeek and Jako authored Sep 27, 2023
1 parent 6f59896 commit c69140e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/model/modx/modconnectorrequest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public function initialize() {
if ($this->modx && is_object($this->modx->context) && $this->modx->context instanceof modContext) {
$ctx = $this->modx->context->get('key');
if (!empty($ctx) && $ctx == 'mgr') {
$ml = $this->modx->getOption('manager_language',null,$this->modx->getOption('cultureKey',null,'en'));
$ml = $this->modx->getOption('manager_language', isset($_SESSION) ? $_SESSION : [],
$this->modx->getOption('cultureKey', null, 'en'));
if (!empty($ml)) {
$this->modx->setOption('cultureKey',$ml);
}
Expand Down

0 comments on commit c69140e

Please sign in to comment.