diff options
author | Aleksander Machniak <alec@alec.pl> | 2022-01-29 10:35:50 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2022-01-29 10:37:35 +0300 |
commit | 4ea9b1b58fbd83d9fe91a9eedb9c8d89e2987b04 (patch) | |
tree | e8c5b41a6535a0b8109f3cf6a76e5747146bf57a | |
parent | fbc424546d9edce78d91f28121a7a26d748c8f28 (diff) |
Fix a couple of PHP8 warnings (#8420)
-rw-r--r-- | plugins/identity_select/identity_select.php | 9 | ||||
-rw-r--r-- | program/lib/Roundcube/rcube_plugin_api.php | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/plugins/identity_select/identity_select.php b/plugins/identity_select/identity_select.php index 5020ff991..0c15b0f09 100644 --- a/plugins/identity_select/identity_select.php +++ b/plugins/identity_select/identity_select.php @@ -38,7 +38,14 @@ class identity_select extends rcube_plugin $rcmail = rcmail::get_instance(); if ($add_headers = (array) $rcmail->config->get('identity_select_headers', [])) { - $p['fetch_headers'] = trim($p['fetch_headers'] . ' ' . strtoupper(join(' ', $add_headers))); + $add_headers = strtoupper(join(' ', $add_headers)); + + if (isset($p['fetch_headers'])) { + $p['fetch_headers'] .= ' ' . $add_headers; + } + else { + $p['fetch_headers'] = $add_headers; + } } return $p; diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php index c59072472..0c7e02147 100644 --- a/program/lib/Roundcube/rcube_plugin_api.php +++ b/program/lib/Roundcube/rcube_plugin_api.php @@ -355,9 +355,12 @@ class rcube_plugin_api } } - list($info['vendor'], $info['name']) = explode('/', $json['name']); - $info['version'] = $json['version']; - $info['license'] = $json['license']; + if (!empty($json['name']) && is_string($json['name']) && strpos($json['name'], '/') !== false) { + list($info['vendor'], $info['name']) = explode('/', $json['name'], 2); + } + + $info['version'] = isset($json['version']) ? $json['version'] : null; + $info['license'] = isset($json['license']) ? $json['license'] : null; $info['require'] = $require; if (!empty($json['homepage'])) { |