Make WordPress Core

Changeset 11776


Ignore:
Timestamp:
08/05/2009 05:56:00 AM (16 years ago)
Author:
azaozz
Message:

Sanitize $include and $exclude in the gallery shortcode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r11771 r11776  
    672672
    673673    if ( !empty($include) ) {
     674        $include = preg_replace( '/[^0-9,]+/', '', $include );
    674675        $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
    675676
     
    679680        }
    680681    } elseif ( !empty($exclude) ) {
     682        $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
    681683        $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
    682684    } else {
Note: See TracChangeset for help on using the changeset viewer.