Skip to content

Commit 6b74cef

Browse files
SergeyBiryukovspacedmonkey
authored andcommitted
Coding Standards: Sanitize input values in wp-trackback.php.
Follow-up to [4676], [12284], [23594], [53719]. Props utsav72640, mukesh27, ankitmaru, dhruvang21, SergeyBiryukov. Fixes #58511. git-svn-id: https://develop.svn.wordpress.org/trunk@60646 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c7dcaa1 commit 6b74cef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/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)