r46867 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46866‎ | r46867 | r46868 >
Date:17:34, 5 February 2009
Author:yaron
Status:deferred
Tags:
Comment:
Various PHP improvements
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_AddPage.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateForm.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateProperty.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_Forms.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_Templates.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_UploadWindow.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_AddPage.php
@@ -19,7 +19,7 @@
2020 wfLoadExtensionMessages('SemanticForms');
2121 }
2222
23 - function execute($query = '') {
 23+ function execute($query) {
2424 $this->setHeaders();
2525 doSpecialAddPage($query);
2626 }
@@ -127,7 +127,7 @@
128128 $form_name = str_replace($forbidden_chars, "", $form_name);
129129
130130 // get title of form
131 - $form_title = Title::newFromText($form_name, SF_NS_FORM);
 131+ $form_title = Title::makeTitleSafe(SF_NS_FORM, $form_name);
132132
133133 // handle submission
134134 $form_submitted = $wgRequest->getCheck('page_name');
Index: trunk/extensions/SemanticForms/specials/SF_Forms.php
@@ -17,7 +17,7 @@
1818 wfLoadExtensionMessages('SemanticForms');
1919 }
2020
21 - function execute() {
 21+ function execute($query) {
2222 $this->setHeaders();
2323 list( $limit, $offset ) = wfCheckLimits();
2424 $rep = new FormsPage();
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
@@ -18,7 +18,7 @@
1919 wfLoadExtensionMessages('SemanticForms');
2020 }
2121
22 - function execute() {
 22+ function execute($query) {
2323 $this->setHeaders();
2424 doSpecialCreateForm();
2525 }
@@ -127,7 +127,7 @@
128128 } else {
129129 # redirect to wiki interface
130130 $wgOut->setArticleBodyOnly(true);
131 - $title = Title::newFromText($form->form_name, SF_NS_FORM);
 131+ $title = Title::makeTitleSafe(SF_NS_FORM, $form->form_name);
132132 $full_text = str_replace('"', '"', $form->createMarkup());
133133 $text = SFUtils::printRedirectForm($title, $full_text, "", $save_page, $preview_page, false, false, false, null, null);
134134 $wgOut->addHTML($text);
Index: trunk/extensions/SemanticForms/specials/SF_CreateProperty.php
@@ -1,7 +1,7 @@
22 <?php
33 /**
44 * A special page holding a form that allows the user to create a semantic
5 - * property (an attribute or relation).
 5+ * property.
66 *
77 * @author Yaron Koren
88 */
@@ -18,7 +18,7 @@
1919 wfLoadExtensionMessages('SemanticForms');
2020 }
2121
22 - function execute() {
 22+ function execute($query) {
2323 $this->setHeaders();
2424 doSpecialCreateProperty();
2525 }
@@ -84,8 +84,7 @@
8585 } else {
8686 # redirect to wiki interface
8787 $wgOut->setArticleBodyOnly(true);
88 - $namespace = SMW_NS_PROPERTY;
89 - $title = Title::newFromText($property_name, $namespace);
 88+ $title = Title::makeTitleSafe(SMW_NS_PROPERTY, $property_name);
9089 $full_text = createPropertyText($property_type, $allowed_values);
9190 // HTML-encode
9291 $full_text = str_replace('"', '&quot;', $full_text);
Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow.php
@@ -24,7 +24,7 @@
2525 wfLoadExtensionMessages('SemanticForms');
2626 }
2727
28 - function execute() {
 28+ function execute($query) {
2929 $this->setHeaders();
3030 doSpecialUploadWindow();
3131 }
Index: trunk/extensions/SemanticForms/specials/SF_Templates.php
@@ -17,7 +17,7 @@
1818 wfLoadExtensionMessages('SemanticForms');
1919 }
2020
21 - function execute() {
 21+ function execute($query) {
2222 $this->setHeaders();
2323 list( $limit, $offset ) = wfCheckLimits();
2424 $rep = new TemplatesPage();
Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php
@@ -22,7 +22,7 @@
2323 wfLoadExtensionMessages('SemanticForms');
2424 }
2525
26 - function execute() {
 26+ function execute($query) {
2727 $this->setHeaders();
2828 doSpecialCreateTemplate();
2929 }
@@ -105,7 +105,7 @@
106106 if ($wgRequest->getVal('del_' . $old_id) != '') {
107107 # do nothing - this field won't get added to the new list
108108 } else {
109 - $field = SFTemplateField::newWithValues($val, $wgRequest->getVal('label_' . $old_id));
 109+ $field = SFTemplateField::create($val, $wgRequest->getVal('label_' . $old_id));
110110 $field->semantic_property = $wgRequest->getVal('semantic_property_' . $old_id);
111111 $field->is_list = $wgRequest->getCheck('is_list_' . $old_id);
112112 $fields[] = $field;
@@ -129,7 +129,7 @@
130130 } else {
131131 // redirect to wiki interface
132132 $wgOut->setArticleBodyOnly(true);
133 - $title = Title::newFromText($template_name, NS_TEMPLATE);
 133+ $title = Title::makeTitleSafe(NS_TEMPLATE, $template_name);
134134 $full_text = SFTemplateField::createTemplateText($template_name, $fields, $category, $aggregating_property, $aggregation_label, $template_format);
135135 // HTML-encode
136136 $full_text = str_replace('"', '&quot;', $full_text);

Status & tagging log