Skip to content

Commit

Permalink
Fix PHP 8.1 deprecation warnings in srm_validate_from_url().
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc committed Jun 1, 2023
1 parent 0180f03 commit a255dc9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions inc/classes/class-srm-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,18 @@ public function load_resources() {
* @return void
*/
public function srm_validate_from_url() {
$_wpnonce = filter_input( INPUT_GET, '_wpnonce', FILTER_SANITIZE_STRING );
if ( ! isset( $_GET['_wpnonce'] ) || ! isset( $_GET['from'] ) ) {
echo 0;
die();
}

$_wpnonce = sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) );
if ( ! wp_verify_nonce( $_wpnonce, 'srm-save-redirect-meta' ) ) {
echo 0;
die();
}

$from = filter_input( INPUT_GET, 'from', FILTER_SANITIZE_STRING );
$from = srm_sanitize_redirect_from( wp_unslash( $_GET['from'] ) );

/**
* SRM treats '/sample-page' and 'sample-page' equally.
Expand Down

0 comments on commit a255dc9

Please sign in to comment.