Index: branches/querypage-work2/phase3/includes/QueryPage.php |
— | — | @@ -352,24 +352,24 @@ |
353 | 353 | } |
354 | 354 | } |
355 | 355 | if ( is_array( $query ) ) { |
356 | | - if ( !is_array( @$query['options'] ) ) { |
357 | | - $options = array (); |
358 | | - } |
| 356 | + $tables = isset( $query['tables'] ) ? (array)$query['tables'] : array(); |
| 357 | + $fields = isset( $query['fields'] ) ? (array)$query['fields'] : array(); |
| 358 | + $conds = isset( $query['conds'] ) ? (array)$query['conds'] : array(); |
| 359 | + $options = isset( $query['options'] ) ? (array)$query['options'] : array(); |
| 360 | + $join_conds = isset( $query['join_conds'] ) ? (array)$query['join_conds'] : array(); |
359 | 361 | if ( count( $order ) ) { |
360 | | - $query['options']['ORDER BY'] = implode( ', ', $order ); |
| 362 | + $options['ORDER BY'] = implode( ', ', $order ); |
361 | 363 | } |
362 | 364 | if ( $limit !== false ) { |
363 | | - $query['options']['LIMIT'] = intval( $limit ); |
| 365 | + $options['LIMIT'] = intval( $limit ); |
364 | 366 | } |
365 | 367 | if ( $offset !== false ) { |
366 | | - $query['options']['OFFSET'] = intval( $offset ); |
| 368 | + $options['OFFSET'] = intval( $offset ); |
367 | 369 | } |
368 | 370 | |
369 | 371 | $dbr = wfGetDB( DB_SLAVE ); |
370 | | - $res = $dbr->select( (array)@$query['tables'], |
371 | | - (array)@$query['fields'], |
372 | | - (array)@$query['conds'], $fname, |
373 | | - $query['options'], (array)@$query['join_conds'] |
| 372 | + $res = $dbr->select( $tables, $fields, $conds, $fname, |
| 373 | + $options, $join_conds |
374 | 374 | ); |
375 | 375 | } else { |
376 | 376 | // Old-fashioned raw SQL style, deprecated |