Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2022-08-25 20:52:56 +0300
committerAleksander Machniak <alec@alec.pl>2022-08-25 20:52:56 +0300
commit79b089e6d3f8cf6840f6c5b1501bc985435df01b (patch)
treef0cc547f3139d7592751e4745c3d75dbfa583ee7
parent8c7911b9f2e60d9ed252a905ed737c070d77159a (diff)
Fix PHP8 warnings (#8677)
-rw-r--r--plugins/managesieve/lib/Roundcube/rcube_sieve_script.php12
-rw-r--r--program/lib/Roundcube/rcube_result_index.php6
2 files changed, 9 insertions, 9 deletions
diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php
index 6c40b0baa..dde6f382d 100644
--- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php
+++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php
@@ -249,13 +249,13 @@ class rcube_sieve_script
$tests[$i] = '';
switch ($test['test']) {
case 'size':
- $tests[$i] .= ($test['not'] ? 'not ' : '');
+ $tests[$i] .= (!empty($test['not']) ? 'not ' : '');
$tests[$i] .= 'size :' . ($test['type'] == 'under' ? 'under ' : 'over ') . $test['arg'];
break;
case 'spamtest':
array_push($exts, 'spamtest');
- $tests[$i] .= ($test['not'] ? 'not ' : '');
+ $tests[$i] .= (!empty($test['not']) ? 'not ' : '');
$tests[$i] .= $test['test'];
$this->add_operator($test, $tests[$i], $exts);
@@ -281,7 +281,7 @@ class rcube_sieve_script
array_push($exts, 'variables');
}
- $tests[$i] .= ($test['not'] ? 'not ' : '');
+ $tests[$i] .= (!empty($test['not']) ? 'not ' : '');
$tests[$i] .= $test['test'];
if ($test['test'] == 'header') {
@@ -301,7 +301,7 @@ class rcube_sieve_script
array_push($exts, 'envelope');
}
- $tests[$i] .= ($test['not'] ? 'not ' : '');
+ $tests[$i] .= (!empty($test['not']) ? 'not ' : '');
$tests[$i] .= $test['test'];
if ($test['test'] == 'address') {
@@ -326,7 +326,7 @@ class rcube_sieve_script
case 'body':
array_push($exts, 'body');
- $tests[$i] .= ($test['not'] ? 'not ' : '') . 'body';
+ $tests[$i] .= (!empty($test['not']) ? 'not ' : '') . 'body';
if (!empty($test['part'])) {
$tests[$i] .= ' :' . $test['part'];
@@ -345,7 +345,7 @@ class rcube_sieve_script
case 'currentdate':
array_push($exts, 'date');
- $tests[$i] .= ($test['not'] ? 'not ' : '') . $test['test'];
+ $tests[$i] .= (!empty($test['not']) ? 'not ' : '') . $test['test'];
$this->add_index($test, $tests[$i], $exts);
diff --git a/program/lib/Roundcube/rcube_result_index.php b/program/lib/Roundcube/rcube_result_index.php
index 9636761e1..0180d62db 100644
--- a/program/lib/Roundcube/rcube_result_index.php
+++ b/program/lib/Roundcube/rcube_result_index.php
@@ -413,18 +413,18 @@ class rcube_result_index
* Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ
* or internal data e.g. MAILBOX, ORDER
*
- * @param string $param Parameter name
+ * @param ?string $param Parameter name
*
* @return array|string Response parameters or parameter value
*/
- public function get_parameters($param=null)
+ public function get_parameters($param = null)
{
$params = $this->params;
$params['MAILBOX'] = $this->mailbox;
$params['ORDER'] = $this->order;
if ($param !== null) {
- return $params[$param];
+ return $params[$param] ?? null;
}
return $params;