Skip to content
Merged

Release #1246

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
6 changes: 3 additions & 3 deletions includes/admin/feedzy-rss-feeds-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1859,13 +1859,13 @@ public function get_source_validity_error( $message = '', $post = '', $css_class
public function ajax() {
check_ajax_referer( FEEDZY_NAME, 'security' );

$post_action = isset( $_POST['_action'] ) ? sanitize_text_field( wp_unslash( $_POST['_action'] ) ) : '';
$post_id = isset( $_POST['id'] ) ? intval( $_POST['id'] ) : '';

if ( ! feedzy_current_user_can() ) {
wp_send_json_error( array( 'msg' => __( 'You do not have permission to do this.', 'feedzy-rss-feeds' ) ), 403 );
}

$post_action = isset( $_POST['_action'] ) ? sanitize_text_field( wp_unslash( $_POST['_action'] ) ) : '';
$post_id = isset( $_POST['id'] ) ? intval( $_POST['id'] ) : '';

switch ( $post_action ) {
case 'validate_clean':
// remove invalid URLs from this category.
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/feedzy-rss-feeds-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@
// Added this to activate post if publish is clicked and sometimes it does not change status.
if (
$source_is_valid && isset( $_POST['custom_post_status'] ) &&
'Publish' === sanitize_text_field( $_POST['custom_post_status'] )

Check warning on line 759 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.Security.ValidatedSanitizedInput.MissingUnslash

$_POST['custom_post_status'] not unslashed before sanitization. Use wp_unslash() or similar
) {
$activate = array(
'ID' => $post_id,
Expand Down Expand Up @@ -1256,13 +1256,13 @@
public function ajax() {
check_ajax_referer( FEEDZY_BASEFILE, 'security' );

$_POST['feedzy_category_meta_noncename'] = isset( $_POST['security'] ) ? sanitize_text_field( wp_unslash( $_POST['security'] ) ) : '';
$_action = isset( $_POST['_action'] ) ? sanitize_text_field( wp_unslash( $_POST['_action'] ) ) : '';

if ( ! feedzy_current_user_can() ) {
wp_send_json_error( array( 'msg' => __( 'You do not have permission to do this.', 'feedzy-rss-feeds' ) ), 403 );
}

$_POST['feedzy_category_meta_noncename'] = isset( $_POST['security'] ) ? sanitize_text_field( wp_unslash( $_POST['security'] ) ) : '';
$_action = isset( $_POST['_action'] ) ? sanitize_text_field( wp_unslash( $_POST['_action'] ) ) : '';

switch ( $_action ) {
case 'import_status':
$this->import_status();
Expand Down Expand Up @@ -1369,7 +1369,7 @@
private function get_taxonomies() {
check_ajax_referer( FEEDZY_BASEFILE, 'security' );

$post_type = isset( $_POST['post_type'] ) ? sanitize_text_field( $_POST['post_type'] ) : '';

Check warning on line 1372 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.Security.ValidatedSanitizedInput.MissingUnslash

$_POST['post_type'] not unslashed before sanitization. Use wp_unslash() or similar
$taxonomies = get_object_taxonomies(
array(
'post_type' => $post_type,
Expand Down Expand Up @@ -1440,7 +1440,7 @@
private function dry_run() {
check_ajax_referer( FEEDZY_BASEFILE, 'security' );

$fields = urldecode( isset( $_POST['fields'] ) ? sanitize_url( $_POST['fields'] ) : '' );

Check warning on line 1443 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.Security.ValidatedSanitizedInput.MissingUnslash

$_POST['fields'] not unslashed before sanitization. Use wp_unslash() or similar
parse_str( $fields, $data );

$feedzy_meta_data = $data['feedzy_meta_data'];
Expand Down Expand Up @@ -1604,7 +1604,7 @@
do_action( 'feedzy_run_cron_extra', $job );
} catch ( Exception $e ) {
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
error_log( '[Feedzy Run Cron][Post title: ' . ( ! empty( $job->post_title ) ? $job->post_title : '' ) . '] Error: ' . $e->getMessage() );

Check warning on line 1607 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.PHP.DevelopmentFunctions.error_log_error_log

error_log() found. Debug code should not normally be used in production.
}

Feedzy_Rss_Feeds_Log::error(
Expand Down Expand Up @@ -1799,7 +1799,7 @@
delete_post_meta( $job->ID, 'import_info' );

// let's increase this time in case spinnerchief/wordai is being used.
set_time_limit( apply_filters( 'feedzy_max_execution_time', 500 ) );

Check warning on line 1802 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

Squiz.PHP.DiscouragedFunctions.Discouraged

The use of function set_time_limit() is discouraged

$count = 0;
$index = 0;
Expand Down Expand Up @@ -3052,7 +3052,7 @@
$new_local_file = str_replace( '.tmp', str_replace( 'image/', '.', $type ), $local_file );

// phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_rename
$renamed = rename( $local_file, $new_local_file );

Check failure on line 3055 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.WP.AlternativeFunctions.rename_rename

rename() is discouraged. Use WP_Filesystem::move() to rename a file.
if ( $renamed ) {
$local_file = $new_local_file;
} else {
Expand Down Expand Up @@ -3086,7 +3086,7 @@
);

// phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_unlink
unlink( $file_array['tmp_name'] );

Check failure on line 3089 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.WP.AlternativeFunctions.unlink_unlink

unlink() is discouraged. Use wp_delete_file() to delete a file.

return false;
}
Expand Down Expand Up @@ -3143,7 +3143,7 @@

if (
( isset( $_POST['nonce'] ) && isset( $_POST['tab'] ) ) &&
wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), sanitize_text_field( $_POST['tab'] ) )

Check warning on line 3146 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.Security.ValidatedSanitizedInput.MissingUnslash

$_POST['tab'] not unslashed before sanitization. Use wp_unslash() or similar
) {
if ( ! empty( $_POST['fz_cron_schedule'] ) ) {
$schedule = sanitize_text_field( wp_unslash( $_POST['fz_cron_schedule'] ) );
Expand Down Expand Up @@ -3396,7 +3396,7 @@
public function save_tab_settings( $settings, $tab ) {
if (
! isset( $_POST['nonce'] ) ||
! wp_verify_nonce( sanitize_text_field( $_POST['nonce'] ), $tab )

Check warning on line 3399 in includes/admin/feedzy-rss-feeds-import.php

View workflow job for this annotation

GitHub Actions / WordPress.org Guidelines Check

WordPress.Security.ValidatedSanitizedInput.MissingUnslash

$_POST['nonce'] not unslashed before sanitization. Use wp_unslash() or similar
) {
return array();
}
Expand Down
Loading