r63472 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63471‎ | r63472 | r63473 >
Date:16:16, 9 March 2010
Author:yaron
Status:deferred
Tags:
Comment:
Replaced hardcoded SQL with API call, removed some HTML-encoding
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_CreateForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
@@ -32,8 +32,9 @@
3333
3434 # get the names of all templates on this site
3535 $all_templates = array();
36 - $sql = "SELECT page_title FROM {$db->tableName( 'page' )} WHERE page_namespace=" . NS_TEMPLATE . " AND page_is_redirect = 0 ORDER BY page_title";
37 - $res = $db->query( $sql );
 36+ $res = $db->select( 'page', 'page_title',
 37+ array( 'page_namespace' => NS_TEMPLATE, 'page_is_redirect' => 0 ),
 38+ array( 'ORDER BY' => 'page_title' ) );
3839 if ($db->numRows( $res ) > 0) {
3940 while ($row = $db->fetchRow($res)) {
4041 $template_name = str_replace('_', ' ', $row[0]);
@@ -128,7 +129,7 @@
129130 # redirect to wiki interface
130131 $wgOut->setArticleBodyOnly(true);
131132 $title = Title::makeTitleSafe(SF_NS_FORM, $form->form_name);
132 - $full_text = str_replace('"', '"', $form->createMarkup());
 133+ $full_text = $form->createMarkup();
133134 $text = SFUtils::printRedirectForm($title, $full_text, "", $save_page, $preview_page, false, false, false, null, null);
134135 $wgOut->addHTML($text);
135136 return;

Status & tagging log