Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace uses of deprecated FILTER_SANITIZE_STRING #1095

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function save_post( $post_id ) {
check_admin_referer( $nonce_action );

if ( isset( $_POST['tix_type'] ) ) {
$value = filter_input( INPUT_POST, 'tix_type', FILTER_SANITIZE_STRING );
$value = filter_input( INPUT_POST, 'tix_type', FILTER_UNSAFE_RAW );
update_post_meta( $post_id, META_KEY, $value );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public function send_refund_request( $payment_token ) {
}

$metadata = array(
'Refund reason' => filter_input( INPUT_POST, 'tix_refund_request_reason', FILTER_SANITIZE_STRING ),
'Refund reason' => filter_input( INPUT_POST, 'tix_refund_request_reason', FILTER_UNSAFE_RAW ),
);

// Create a new Idempotency token for the refund request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public static function render_available_fields( $context = 'public', array $fiel
*/
public static function export_to_file() {

$fields = filter_input( INPUT_POST, 'fields', FILTER_SANITIZE_STRING, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$fields = filter_input( INPUT_POST, 'fields', FILTER_UNSAFE_RAW, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$action = filter_input( INPUT_POST, 'action' );
$nonce = filter_input( INPUT_POST, self::$slug . '-nonce' );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,25 +216,22 @@ public function get_data() {
}

/**
* Get all Meetup posts which have status changed between given time fram
* Get all Meetup posts which have status changed between given time frame.
*
* @return array
*/
protected function get_meetup_posts() {
global $wpdb;
$meetup_post_type = WCPT_MEETUP_SLUG;
$meetup_post_objs = $wpdb->get_results(
$wpdb->prepare(
"
SELECT DISTINCT post_id
FROM {$wpdb->prefix}postmeta
WHERE
meta_key LIKE '_status_change_log_$meetup_post_type%'
AND
meta_value >= %d
AND
meta_value <= %d
",
$wpdb->prepare( "
SELECT DISTINCT post_id
FROM {$wpdb->prefix}postmeta
WHERE
meta_key LIKE %s AND
meta_value >= %d AND
meta_value <= %d",
sprintf( '_status_change_log_%s%%', $meetup_post_type ),
$this->range->start->getTimestamp(),
$this->range->end->getTimestamp()
)
Expand Down Expand Up @@ -324,7 +321,7 @@ public static function render_admin_page() {
$refresh = filter_input( INPUT_POST, 'refresh', FILTER_VALIDATE_BOOLEAN );
$action = filter_input( INPUT_POST, 'action' );
$nonce = filter_input( INPUT_POST, self::$slug . '-nonce' );
$fields = filter_input( INPUT_POST, 'fields', FILTER_SANITIZE_STRING, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$fields = filter_input( INPUT_POST, 'fields', FILTER_UNSAFE_RAW, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$statuses = Meetup_Application::get_post_statuses();

$field_defaults = array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public static function render_admin_page() {
public static function export_to_file() {
$start_date = filter_input( INPUT_POST, 'start-date' );
$end_date = filter_input( INPUT_POST, 'end-date' );
$fields = filter_input( INPUT_POST, 'fields', FILTER_SANITIZE_STRING, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$fields = filter_input( INPUT_POST, 'fields', FILTER_UNSAFE_RAW, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$action = filter_input( INPUT_POST, 'action' );
$nonce = filter_input( INPUT_POST, self::$slug . '-nonce' );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ public static function export_to_file() {
$start_date = filter_input( INPUT_POST, 'start-date' );
$end_date = filter_input( INPUT_POST, 'end-date' );
$status = filter_input( INPUT_POST, 'status' );
$fields = filter_input( INPUT_POST, 'fields', FILTER_SANITIZE_STRING, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$fields = filter_input( INPUT_POST, 'fields', FILTER_UNSAFE_RAW, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
$refresh = filter_input( INPUT_POST, 'refresh', FILTER_VALIDATE_BOOLEAN );
$action = filter_input( INPUT_POST, 'action' );
$nonce = filter_input( INPUT_POST, self::$slug . '-nonce' );
Expand Down
4 changes: 2 additions & 2 deletions public_html/wp-content/plugins/wordcamp-reports/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function add_reports_page() {
* @return void
*/
function render_page() {
$report = filter_input( INPUT_GET, 'report', FILTER_SANITIZE_STRING );
$report = filter_input( INPUT_GET, 'report', FILTER_UNSAFE_RAW );
$report_class = get_report_class_by_slug( $report );

$reports_with_admin = array_filter(
Expand Down Expand Up @@ -255,7 +255,7 @@ function enqueue_admin_assets( $hook_suffix ) {
filemtime( get_assets_dir_path() . 'css/admin-common.css' )
);

$report = filter_input( INPUT_GET, 'report', FILTER_SANITIZE_STRING );
$report = filter_input( INPUT_GET, 'report', FILTER_UNSAFE_RAW );
$report_class = get_report_class_by_slug( $report );

if ( ! is_null( $report_class ) && method_exists( $report_class, 'enqueue_admin_assets' ) ) {
Expand Down
Loading