From 1e3fb4d13c18786cd1ba73324f3b1b98907712aa Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 20 Nov 2014 16:00:09 +0000 Subject: [PATCH] Validate image data. Merges [30458] to the 3.7 branch. Built from https://develop.svn.wordpress.org/branches/3.7@30465 git-svn-id: http://core.svn.wordpress.org/branches/3.7@30456 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index f2e636bbb8..56f0457ce4 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -314,6 +314,12 @@ function wp_read_image_metadata( $file ) { $meta[ $key ] = utf8_encode( $meta[ $key ] ); } + foreach ( $meta as &$value ) { + if ( is_string( $value ) ) { + $value = wp_kses_post( $value ); + } + } + return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType ); }