diff --git a/includes/admin/class-pr-core-admin-columns.php b/includes/admin/class-pr-core-admin-columns.php index 335db87..c45c307 100644 --- a/includes/admin/class-pr-core-admin-columns.php +++ b/includes/admin/class-pr-core-admin-columns.php @@ -1,5 +1,7 @@ ', esc_attr( $key ), esc_html( $label ), - $value + $value // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_attr applied on assignment ); } @@ -144,8 +146,8 @@ class PR_Core_Peptide_Metaboxes { echo ''; foreach ( $rows as $row ) { - $dose = $row->dose_min !== null ? number_format( $row->dose_min, 2 ) : '?'; - if ( $row->dose_max !== null && $row->dose_max !== $row->dose_min ) { + $dose = null !== $row->dose_min ? number_format( $row->dose_min, 2 ) : '?'; + if ( null !== $row->dose_max && $row->dose_max !== $row->dose_min ) { $dose .= ' – ' . number_format( $row->dose_max, 2 ); } $dose .= ' ' . esc_html( $row->dose_unit ); @@ -243,7 +245,7 @@ class PR_Core_Peptide_Metaboxes { foreach ( $meta_fields as $key => $config ) { $input_key = 'pr_core_' . $key; - if ( ! isset( $_POST[ $input_key ] ) ) { + if ( ! isset( $_POST[ $input_key ] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- existence check only; unslash+sanitize below continue; } @@ -256,10 +258,10 @@ class PR_Core_Peptide_Metaboxes { } // Set last_editorial_review_at when status changes to published. - $new_review_status = sanitize_text_field( $_POST['pr_core_editorial_review_status'] ?? '' ); + $new_review_status = sanitize_text_field( wp_unslash( $_POST['pr_core_editorial_review_status'] ?? '' ) ); if ( 'published' === $new_review_status ) { $old_status = get_post_meta( $post_id, 'editorial_review_status', true ); - if ( $old_status !== 'published' ) { + if ( 'published' !== $old_status ) { update_post_meta( $post_id, 'last_editorial_review_at', current_time( 'mysql' ) ); update_post_meta( $post_id, 'medical_editor_id', get_current_user_id() ); } diff --git a/includes/admin/class-pr-core-repo-daily-metaboxes.php b/includes/admin/class-pr-core-repo-daily-metaboxes.php index 313f258..afe2551 100755 --- a/includes/admin/class-pr-core-repo-daily-metaboxes.php +++ b/includes/admin/class-pr-core-repo-daily-metaboxes.php @@ -1,5 +1,7 @@ 'style="background:#f44336;color:white;padding:4px 8px;border-radius:3px;"', default => 'style="background:#4caf50;color:white;padding:4px 8px;border-radius:3px;"', }; - echo '' . esc_html( ucfirst( $status ) ) . '

'; + echo '' . esc_html( ucfirst( $status ) ) . '

'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- badge_class is a hardcoded match expression echo '

' . esc_html__( 'Verification Notes', 'peptide-repo-core' ) . ':
'; printf( diff --git a/includes/admin/class-pr-core-verification-widget.php b/includes/admin/class-pr-core-verification-widget.php index 90e07c5..d2b86f6 100644 --- a/includes/admin/class-pr-core-verification-widget.php +++ b/includes/admin/class-pr-core-verification-widget.php @@ -1,5 +1,7 @@