Fixup deprecations on PHP 8 (#2592)

* Fixup deprecations on PHP 8

Fix #2448

* Configure a default fallback for getInput function

* Appease phpcs

* Avoid changing getInput function

Revert "Configure a default fallback for getInput function"

This reverts commit 94004c5104de6b84bd4c72356806d994c05a0119.
This commit is contained in:
somini 2022-04-03 08:53:13 +01:00 committed by GitHub
parent a5eb02d3c3
commit d123e6007e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -54,7 +54,7 @@ class FeedReducerBridge extends FeedExpander {
}
public function getName(){
$trimmedPercentage = preg_replace('/[^0-9]/', '', $this->getInput('percentage'));
$trimmedPercentage = preg_replace('/[^0-9]/', '', $this->getInput('percentage') ?? '');
return parent::getName() . ' [' . $trimmedPercentage . '%]';
}
}

View File

@ -88,7 +88,7 @@ This bridge is not fetching its content through a secure connection</div>';
$form .= '<label for="'
. $idArg
. '">'
. filter_var($inputEntry['name'], FILTER_SANITIZE_STRING)
. filter_var($inputEntry['name'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)
. '</label>'
. PHP_EOL;
@ -102,10 +102,12 @@ This bridge is not fetching its content through a secure connection</div>';
$form .= self::getCheckboxInput($inputEntry, $idArg, $id);
}
if(isset($inputEntry['title']))
$form .= '<i class="info" title="' . filter_var($inputEntry['title'], FILTER_SANITIZE_STRING) . '">i</i>';
else
if(isset($inputEntry['title'])) {
$title_filtered = filter_var($inputEntry['title'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$form .= '<i class="info" title="' . $title_filtered . '">i</i>';
} else {
$form .= '<i class="no-info"></i>';
}
}
$form .= '</div>';
@ -153,9 +155,9 @@ This bridge is not fetching its content through a secure connection</div>';
. ' id="'
. $id
. '" type="text" value="'
. filter_var($entry['defaultValue'], FILTER_SANITIZE_STRING)
. filter_var($entry['defaultValue'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)
. '" placeholder="'
. filter_var($entry['exampleValue'], FILTER_SANITIZE_STRING)
. filter_var($entry['exampleValue'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)
. '" name="'
. $name
. '" />'