Skip to content

Commit 16068fe

Browse files
committed
- Run the WordPress VIP scans on Authors publishpress#639
1 parent b92787f commit 16068fe

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/core/Classes/Admin_Ajax.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ public static function handle_mapped_author_validation()
237237
);
238238
} else {
239239
$author_slug = !empty($_POST['author_slug']) ? sanitize_title($_POST['author_slug']) : '';
240-
$author_id = !empty($_POST['author_id']) ? (int)($_POST['author_id']) : 0;
241-
$term_id = !empty($_POST['term_id']) ? (int)($_POST['term_id']) : 0;
240+
$author_id = !empty($_POST['author_id']) ? (int) $_POST['author_id'] : 0;
241+
$term_id = !empty($_POST['term_id']) ? (int) $_POST['term_id'] : 0;
242242

243243
if ($author_id > 0) {
244244
$author = Author::get_by_user_id($author_id);

src/core/Classes/Author_Editor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ class="<?php echo esc_attr('form-field term-' . $key . '-wrap '. $tab_class); ?>
478478
<label for="<?php echo esc_attr($avatar_option_key.'-'.$key.'-options'); ?>">
479479
<?php echo esc_html($avatar_option_data['label']); ?>
480480
<?php if (isset($avatar_option_data['description'])) : ?>
481-
<span class="description"><?php echo $avatar_option_data['description']; ?></span>
481+
<span class="description"><?php echo $avatar_option_data['description']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
482482
<?php endif; ?>
483483
</label>
484484
</p>

src/core/Plugin.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1041,9 +1041,10 @@ public function filter_wp_get_object_terms($terms, $object_ids, $taxonomies, $ar
10411041
$orderby = 'ORDER BY tr.term_order';
10421042
$order = 'ASC';
10431043
$object_ids = (int)$object_ids;
1044+
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
10441045
$raw_coauthors = $wpdb->get_results(
1045-
$wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
1046-
"SELECT t.name, t.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (%s) AND tr.object_id IN (%s) $orderby $order",
1046+
$wpdb->prepare(
1047+
"SELECT t.name, t.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (%s) AND tr.object_id IN (%s) $orderby $order", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
10471048
$this->coauthor_taxonomy,
10481049
$object_ids
10491050
)

src/functions/notify.php

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ function wp_notify_postauthor($comment_id, $comment_type = '')
147147
$subject = apply_filters('comment_notification_subject', $subject, $comment_id);
148148
$message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id);
149149

150+
// phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail
150151
wp_mail($author->user_email, $subject, $notify_message, $message_headers);
151152
}
152153

0 commit comments

Comments
 (0)