diff options
author | Eduardo Mozart de Oliveira <2974895+eduardomozart@users.noreply.github.com> | 2023-08-09 22:31:19 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 22:31:19 -0300 |
commit | 95465e17377c8944ea8522dae4ad77899425575d (patch) | |
tree | d6c2f627c6b8240fce02f315e09da4879417fce6 | |
parent | c6ca82d48e9e426040b2ad9c737031aa9584bcc1 (diff) | |
download | dokuwiki-95465e17377c8944ea8522dae4ad77899425575d.tar.gz dokuwiki-95465e17377c8944ea8522dae4ad77899425575d.zip |
Fixes PHP 8 warning when editing drafts on PHP 8
The following error is thrown on PHP 8.3 while attempt to edit a Draft:
Warning: Undefined array key "draft" in /home/robertinho/public_html/wiki/inc/Action/Draft.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home/robertinho/public_html/wiki/inc/Action/Draft.php:34) in /home/robertinho/public_html/wiki/inc/actions.php on line 38
-rw-r--r-- | inc/Action/Draft.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/Action/Draft.php b/inc/Action/Draft.php index 0c33dab54..daa39c3e4 100644 --- a/inc/Action/Draft.php +++ b/inc/Action/Draft.php @@ -31,7 +31,7 @@ class Draft extends AbstractAction { parent::checkPreconditions(); global $INFO; - if (!file_exists($INFO['draft'])) throw new ActionException('edit'); + if (!isset($INFO['draft']) || !file_exists($INFO['draft'])) throw new ActionException('edit'); } /** @inheritdoc */ |