PluginProbe
Meow Gallery / 4.2.2
Meow Gallery v4.2.2
5.5.5 5.5.4 5.5.3 5.5.2 5.5.1 5.5.0 5.4.9 5.4.8 5.4.7 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 All 157 releases
← All changes | classes/builders/core.php +6 -1 4.1.7 → 4.2.2 View file →
@@ -46,13 +46,18 @@
46 46 }
47 47
48 48 function prepare_data( $idsStr ) {
49 49 global $wpdb;
50 +
51 + // Escape the array of IDs for SQL
52 + $ids = array_map( 'intval', explode(',', $idsStr ) );
53 + $idsStr = implode( ',', $ids );
54 +
50 55 $query = "SELECT p.ID id, p.post_excerpt caption, m.meta_value meta
51 56 FROM $wpdb->posts p, $wpdb->postmeta m
52 57 WHERE m.meta_key = '_wp_attachment_metadata'
53 58 AND p.ID = m.post_id
54 - AND p.ID IN (" . esc_sql( $idsStr ) . ")";
59 + AND p.ID IN (" . $idsStr . ")";
55 60 $res = $wpdb->get_results( $query );
56 61 $this->ids = explode( ',', $idsStr );
57 62 foreach ( $res as $r ) {
58 63 $this->data[$r->id] = array( 'caption' => $r->caption,'meta' => unserialize( $r->meta ) );