From 3ed146d512da46ce2be541e5891ea7fad529c165 Mon Sep 17 00:00:00 2001 From: Lem Smyth Date: Sun, 27 Feb 2022 11:40:05 -0600 Subject: [PATCH] sanitize supports add form --- classes/LBRY_Admin.php | 2 +- templates/supports-add-form.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/LBRY_Admin.php b/classes/LBRY_Admin.php index a62fbba..efabafc 100644 --- a/classes/LBRY_Admin.php +++ b/classes/LBRY_Admin.php @@ -476,7 +476,7 @@ class LBRY_Admin */ public function add_supports() { - if ( ( $_POST['post_id'] ) && ( $_POST['post_id'] !== null ) ) { + if ( ( $_POST['post_id'] ) && ( absint( $_POST['post_id'] ) ) ) { $redirect_url = admin_url( add_query_arg( array( 'post' => $_POST['post_id'], 'action' => 'edit' ), 'post.php') ); } else { $redirect_url = admin_url( add_query_arg( array( 'page' => 'lbrypress', 'tab' => 'channels' ), 'options.php' ) ); diff --git a/templates/supports-add-form.php b/templates/supports-add-form.php index cbe0dc8..ef62cca 100644 --- a/templates/supports-add-form.php +++ b/templates/supports-add-form.php @@ -34,10 +34,10 @@ if ( current_user_can( 'manage_options' ) ) {
- - - - + + + +