Skip to content

Commit e3ab35f

Browse files
Coding Standards: Sanitize input values in wp-trackback.php.
Follow-up to [4676], [12284], [23594], [53719]. Props utsav72640, mukesh27, ankitmaru, dhruvang21, SergeyBiryukov. Fixes #58511. Built from https://develop.svn.wordpress.org/trunk@60646 git-svn-id: https://core.svn.wordpress.org/trunk@59982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent d62c464 commit e3ab35f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.9-alpha-60645';
19+
$wp_version = '6.9-alpha-60646';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

wp-trackback.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ function trackback_response( $error = 0, $error_message = '' ) {
5050
$post_id = (int) $post_id[ count( $post_id ) - 1 ];
5151
}
5252

53-
$trackback_url = isset( $_POST['url'] ) ? $_POST['url'] : '';
54-
$charset = isset( $_POST['charset'] ) ? $_POST['charset'] : '';
53+
$trackback_url = isset( $_POST['url'] ) ? sanitize_url( $_POST['url'] ) : '';
54+
$charset = isset( $_POST['charset'] ) ? sanitize_text_field( $_POST['charset'] ) : '';
5555

5656
// These three are stripslashed here so they can be properly escaped after mb_convert_encoding().
57-
$title = isset( $_POST['title'] ) ? wp_unslash( $_POST['title'] ) : '';
58-
$excerpt = isset( $_POST['excerpt'] ) ? wp_unslash( $_POST['excerpt'] ) : '';
59-
$blog_name = isset( $_POST['blog_name'] ) ? wp_unslash( $_POST['blog_name'] ) : '';
57+
$title = isset( $_POST['title'] ) ? sanitize_text_field( wp_unslash( $_POST['title'] ) ) : '';
58+
$excerpt = isset( $_POST['excerpt'] ) ? sanitize_textarea_field( wp_unslash( $_POST['excerpt'] ) ) : '';
59+
$blog_name = isset( $_POST['blog_name'] ) ? sanitize_text_field( wp_unslash( $_POST['blog_name'] ) ) : '';
6060

6161
if ( $charset ) {
6262
$charset = str_replace( array( ',', ' ' ), '', strtoupper( trim( $charset ) ) );

0 commit comments

Comments
 (0)