Skip to content

Commit

Permalink
Fix PHP warning when user not logged in
Browse files Browse the repository at this point in the history
Warning: Trying to access array offset on value of type null in
./dokuwiki/move/action/rename.php on line 42

$USERINFO is null when user is not logged in.

Regression introduced by 0af31bb (#246).

Fixes #256, #255
  • Loading branch information
dregad committed Apr 26, 2024
1 parent 4f423b7 commit f175a7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action/rename.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ public function handle_init() {
global $USERINFO;

$JSINFO['move_renameokay'] = $this->renameOkay($INFO['id']);
$JSINFO['move_allowrename'] = auth_isMember($this->getConf('allowrename'), $INPUT->server->str('REMOTE_USER'), (array) $USERINFO['grps']);
$JSINFO['move_allowrename'] = auth_isMember(
$this->getConf('allowrename'),
$INPUT->server->str('REMOTE_USER'),
$USERINFO['grps'] ?? []
);
}

/**
Expand Down

0 comments on commit f175a7a

Please sign in to comment.