Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php |
— | — | @@ -8,8 +8,6 @@ |
9 | 9 | * @ingroup SF |
10 | 10 | */ |
11 | 11 | |
12 | | -if ( !defined( 'MEDIAWIKI' ) ) die(); |
13 | | - |
14 | 12 | /** |
15 | 13 | * @ingroup SFSpecialPages |
16 | 14 | */ |
— | — | @@ -85,11 +83,15 @@ |
86 | 84 | |
87 | 85 | // Get the names of all templates on this site. |
88 | 86 | $all_templates = array(); |
89 | | - $res = $db->select( 'page', 'page_title', |
| 87 | + $res = $db->select( |
| 88 | + 'page', |
| 89 | + 'page_title', |
90 | 90 | array( 'page_namespace' => NS_TEMPLATE, 'page_is_redirect' => 0 ), |
91 | | - array( 'ORDER BY' => 'page_title' ) ); |
| 91 | + array( 'ORDER BY' => 'page_title' ) |
| 92 | + ); |
| 93 | + |
92 | 94 | if ( $db->numRows( $res ) > 0 ) { |
93 | | - foreach ( $res as $row ) { |
| 95 | + while ( $row = $db->fetchRow( $res ) ) { |
94 | 96 | $template_name = str_replace( '_', ' ', $row[0] ); |
95 | 97 | $all_templates[] = $template_name; |
96 | 98 | } |
Index: trunk/extensions/SemanticForms/includes/SF_AutocompleteAPI.php |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | $res = $db->select( $from_clause, "DISTINCT $value_field", |
147 | 147 | $conditions, __METHOD__, $sql_options ); |
148 | 148 | |
149 | | - foreach ( $res as $row ) { |
| 149 | + while ( $row = $db->fetchRow( $res ) ) { |
150 | 150 | if ( $substring != null ) { |
151 | 151 | $values[] = array( 'title' => str_replace( '_', ' ', $row[0] ) ); |
152 | 152 | } else { |