Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -200,11 +200,12 @@ |
201 | 201 | */ |
202 | 202 | static function getAllForms() { |
203 | 203 | $dbr = wfGetDB( DB_SLAVE ); |
204 | | - $query = "SELECT page_title FROM " . $dbr->tableName( 'page' ) . |
205 | | - " WHERE page_namespace = " . SF_NS_FORM . |
206 | | - " AND page_is_redirect = 0" . |
207 | | - " ORDER BY page_title"; |
208 | | - $res = $dbr->query( $query ); |
| 204 | + $res = $dbr->select( $dbr->tableNames( 'page' ), |
| 205 | + 'page_title', |
| 206 | + array( 'page_namespace' => SF_NS_FORM, |
| 207 | + 'page_is_redirect' => false ), |
| 208 | + __METHOD__, |
| 209 | + array( 'ORDER BY' => 'page_title' ) ); |
209 | 210 | $form_names = array(); |
210 | 211 | while ( $row = $dbr->fetchRow( $res ) ) { |
211 | 212 | $form_names[] = str_replace( '_', ' ', $row[0] ); |
— | — | @@ -372,10 +373,10 @@ |
373 | 374 | $substring = str_replace( "'", "\'", $substring ); |
374 | 375 | $conditions .= " AND (LOWER(CONVERT(`page_title` USING utf8)) LIKE '$substring%' OR LOWER(CONVERT(`page_title` USING utf8)) LIKE '%\_$substring%')"; |
375 | 376 | } |
376 | | - $sql_options['ORDER BY'] = 'page_title'; |
377 | 377 | $res = $db->select( $db->tableNames( 'page' ), |
378 | 378 | 'page_title', |
379 | | - $conditions, __METHOD__, $sql_options ); |
| 379 | + $conditions, __METHOD__, |
| 380 | + array( 'ORDER BY' => 'page_title' ) ); |
380 | 381 | while ( $row = $db->fetchRow( $res ) ) { |
381 | 382 | $cur_value = str_replace( '_', ' ', $row[0] ); |
382 | 383 | if ( $substring == null ) { |