Skip to content

Commit

Permalink
👌 IMPROVE: Replace FILTER_SANITIZE_STRING (PHP 8.2 deprecated ) with …
Browse files Browse the repository at this point in the history
…FILTER_SANITIZE_URL for URL sanitization
  • Loading branch information
stevengliebe committed May 9, 2023
1 parent 1e3f66a commit 32dad24
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions includes/page.php
Expand Up @@ -54,9 +54,8 @@ function wie_import_export_page_content()
// Don't show content below.
return;
}

$self = isset($_SERVER['PHP_SELF']) ? filter_var(wp_unslash($_SERVER['PHP_SELF']), FILTER_SANITIZE_STRING) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
$page = isset($_GET['page']) ? filter_var(wp_unslash($_GET['page']), FILTER_SANITIZE_STRING) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
$self = isset($_SERVER['PHP_SELF']) ? wp_unslash(filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_URL)) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
$page = isset($_GET['page']) ? wp_unslash(filter_input(INPUT_GET, 'page', FILTER_SANITIZE_URL)) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended

?>

Expand Down Expand Up @@ -170,8 +169,8 @@ function wie_show_import_results()
{
global $wie_import_results;

$self = isset($_SERVER['PHP_SELF']) ? filter_var(wp_unslash($_SERVER['PHP_SELF']), FILTER_SANITIZE_STRING) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
$page = isset($_GET['page']) ? filter_var(wp_unslash($_GET['page']), FILTER_SANITIZE_STRING) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
$self = isset($_SERVER['PHP_SELF']) ? wp_unslash(filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_URL)) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
$page = isset($_GET['page']) ? wp_unslash(filter_input(INPUT_GET, 'page', FILTER_SANITIZE_URL)) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended

?>

Expand Down

0 comments on commit 32dad24

Please sign in to comment.