From f69fdb619816e3b943b772aeaba7f4b287dc9ee0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 13 Sep 2012 17:06:25 +0000 Subject: [PATCH] Don't sanitize include and exclude in gallery_shortcode(), as this is handled further down the stack, and better. props SergeyBiryukov, TobiasBg. fixes #21827. git-svn-id: http://core.svn.wordpress.org/trunk@21833 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 0f7bd0e20e..25dca9e57a 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -817,7 +817,6 @@ function gallery_shortcode($attr) { } if ( !empty($include) ) { - $include = preg_replace( '/[^0-9,]+/', '', $include ); $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); @@ -825,7 +824,6 @@ function gallery_shortcode($attr) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( !empty($exclude) ) { - $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );