Index: query.php
===================================================================
--- query.php	(revision 17856)
+++ query.php	(working copy)
@@ -2286,8 +2286,15 @@
 
 		$where .= $search . $whichauthor . $whichmimetype;
 
-		if ( empty($q['order']) || ((strtoupper($q['order']) != 'ASC') && (strtoupper($q['order']) != 'DESC')) )
-			$q['order'] = 'DESC';
+		if ( empty($q['order']) ) {
+			$order_array[0] = $q['order'] = 'DESC';
+		} else {
+			$order_array = explode(' ', $q['order'] );
+			foreach( $order_array as $i => $order ) {
+				$order_array[ $i ] = strtoupper( $order ) != 'ASC' && strtoupper( $order ) != 'DESC' ? 'DESC' : strtoupper( $order );
+			}
+			$q['order'] = $order_array[ 0 ]; // Set order to the first item for backward compat
+		}
 
 		// Order by
 		if ( empty($q['orderby']) ) {
@@ -2335,13 +2342,9 @@
 						$orderby = "$wpdb->posts.post_" . $orderby;
 				}
 
-				$q['orderby'] .= (($i == 0) ? '' : ',') . $orderby;
+				$q['orderby'] .= (($i == 0) ? '' : ',') . $orderby . ' ' . $order_array[ ( $i % count( $order_array ) ) ];
 			}
 
-			// append ASC or DESC at the end
-			if ( !empty($q['orderby']))
-				$q['orderby'] .= " {$q['order']}";
-
 			if ( empty($q['orderby']) )
 				$q['orderby'] = "$wpdb->posts.post_date ".$q['order'];
 		}
