All pastes #802290 Raw Edit

Miscellany

public text v1 · immutable
#802290 ·published 2007-11-30 01:21 UTC
rendered paste body
Index: posts.php
===================================================================
--- posts.php (revision 1158)
+++ posts.php (working copy)
@@ -101,8 +101,15 @@
          $params[]= Post::type( $paramset['content_type'] );
        }
        if ( isset( $paramset['slug'] ) ) {
-         $where[]= "slug= ?";
-         $params[]= $paramset['slug'];
+          if ( is_array( $paramset['slug'] ) ) {
+           $where[]= "slug IN (" . implode( ',', array_fill( 0, count( $paramset['slug'] ), '?' ) ) . ")";
+           foreach ( $paramset['slug'] as $slug ) {
+             $params[]= $slug;
+            }
+          } else {
+           $where[]= "slug= ?";
+           $params[]= $paramset['slug'];
+         }
        }
        if ( isset( $paramset['user_id'] ) ) {
          $where[]= "user_id= ?";