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 94004c5104.
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(){ public function getName(){
$trimmedPercentage = preg_replace('/[^0-9]/', '', $this->getInput('percentage')); $trimmedPercentage = preg_replace('/[^0-9]/', '', $this->getInput('percentage') ?? '');
return parent::getName() . ' [' . $trimmedPercentage . '%]'; 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="' $form .= '<label for="'
. $idArg . $idArg
. '">' . '">'
. filter_var($inputEntry['name'], FILTER_SANITIZE_STRING) . filter_var($inputEntry['name'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)
. '</label>' . '</label>'
. PHP_EOL; . PHP_EOL;
@ -102,10 +102,12 @@ This bridge is not fetching its content through a secure connection</div>';
$form .= self::getCheckboxInput($inputEntry, $idArg, $id); $form .= self::getCheckboxInput($inputEntry, $idArg, $id);
} }
if(isset($inputEntry['title'])) if(isset($inputEntry['title'])) {
$form .= '<i class="info" title="' . filter_var($inputEntry['title'], FILTER_SANITIZE_STRING) . '">i</i>'; $title_filtered = filter_var($inputEntry['title'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
else $form .= '<i class="info" title="' . $title_filtered . '">i</i>';
} else {
$form .= '<i class="no-info"></i>'; $form .= '<i class="no-info"></i>';
}
} }
$form .= '</div>'; $form .= '</div>';
@ -153,9 +155,9 @@ This bridge is not fetching its content through a secure connection</div>';
. ' id="' . ' id="'
. $id . $id
. '" type="text" value="' . '" type="text" value="'
. filter_var($entry['defaultValue'], FILTER_SANITIZE_STRING) . filter_var($entry['defaultValue'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)
. '" placeholder="' . '" placeholder="'
. filter_var($entry['exampleValue'], FILTER_SANITIZE_STRING) . filter_var($entry['exampleValue'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)
. '" name="' . '" name="'
. $name . $name
. '" />' . '" />'