aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPhy <git@phy25.com>2019-12-01 14:01:52 -0500
committerPhy <git@phy25.com>2019-12-01 14:01:52 -0500
commit3e9ae63d53254e2111f41edfd84e8122f8ac8fcc (patch)
treedba016a03cd083a4eae008868f776615635510d5
parent06f34f54eaec5d57a4958957be7c252e8d5ca5d0 (diff)
downloaddokuwiki-3e9ae63d53254e2111f41edfd84e8122f8ac8fcc.tar.gz
dokuwiki-3e9ae63d53254e2111f41edfd84e8122f8ac8fcc.zip
PHP8 fix part 3: Trying to access array offset on value of type bool/null
-rw-r--r--inc/Mailer.class.php6
-rw-r--r--inc/auth.php4
-rw-r--r--inc/changelog.php4
-rw-r--r--inc/common.php4
4 files changed, 9 insertions, 9 deletions
diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php
index 328073bc1..2dc36fe69 100644
--- a/inc/Mailer.class.php
+++ b/inc/Mailer.class.php
@@ -350,7 +350,7 @@ class Mailer {
* addresses. Addresses must be separated by a comma. If the display
* name includes a comma then it MUST be properly enclosed by '"' to
* prevent spliting at the wrong point.
- *
+ *
* Example:
* cc("föö <foo@bar.com>, me@somewhere.com","TBcc");
* to("foo, Dr." <foo@bar.com>, me@somewhere.com");
@@ -644,8 +644,8 @@ class Mailer {
'TITLE' => $conf['title'],
'DOKUWIKIURL' => DOKU_URL,
'USER' => $INPUT->server->str('REMOTE_USER'),
- 'NAME' => $INFO['userinfo']['name'],
- 'MAIL' => $INFO['userinfo']['mail']
+ 'NAME' => $INFO['userinfo'] ? $INFO['userinfo']['name'] : '',
+ 'MAIL' => $INFO['userinfo'] ? $INFO['userinfo']['mail'] : ''
);
$signature = str_replace(
'@DOKUWIKIURL@',
diff --git a/inc/auth.php b/inc/auth.php
index 74d4f96fc..0630a76f0 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -472,7 +472,7 @@ function auth_ismanager($user = null, $groups = null, $adminonly = false) {
}
}
if(is_null($groups)) {
- $groups = (array) $USERINFO['grps'];
+ $groups = $USERINFO ? (array) $USERINFO['grps'] : array();
}
// check superuser match
@@ -566,7 +566,7 @@ function auth_quickaclcheck($id) {
global $INPUT;
# if no ACL is used always return upload rights
if(!$conf['useacl']) return AUTH_UPLOAD;
- return auth_aclcheck($id, $INPUT->server->str('REMOTE_USER'), $USERINFO['grps']);
+ return auth_aclcheck($id, $INPUT->server->str('REMOTE_USER'), is_array($USERINFO) ? $USERINFO['grps'] : array());
}
/**
diff --git a/inc/changelog.php b/inc/changelog.php
index 93dd2271c..ed4fc671f 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -121,10 +121,10 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
$meta['date']['created'] = $oldmeta['persistent']['date']['created'];
$meta['date']['modified'] = $created; // use the files ctime here
$meta['creator'] = $oldmeta['persistent']['creator'];
- if ($user) $meta['contributor'][$user] = $INFO['userinfo']['name'];
+ if ($user) $meta['contributor'][$user] = $INFO['userinfo'] ? $INFO['userinfo']['name'] : null;
} elseif (!$minor) { // non-minor modification
$meta['date']['modified'] = $date;
- if ($user) $meta['contributor'][$user] = $INFO['userinfo']['name'];
+ if ($user) $meta['contributor'][$user] = $INFO['userinfo'] ? $INFO['userinfo']['name'] : null;
}
$meta['last_change'] = $logline;
p_set_metadata($id, $meta);
diff --git a/inc/common.php b/inc/common.php
index f7c528cae..6a3892c67 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1189,8 +1189,8 @@ function parsePageTemplate(&$data) {
\dokuwiki\Utf8\PhpString::ucwords($page),
\dokuwiki\Utf8\PhpString::strtoupper($page),
$INPUT->server->str('REMOTE_USER'),
- $USERINFO['name'],
- $USERINFO['mail'],
+ $USERINFO ? $USERINFO['name'] : '',
+ $USERINFO ? $USERINFO['mail'] : '',
$conf['dformat'],
), $tpl
);