r26214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26213‎ | r26214 | r26215 >
Date:17:41, 28 September 2007
Author:yaron
Status:old
Tags:
Comment:
Improved checks of inputs so they can work with non-English languages
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_CreateForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
@@ -43,18 +43,18 @@
4444 if ($action == "template") {
4545 # if the button was pressed to remove this template, just don't
4646 # add it to the array
47 - if ($wgRequest->getVal("del_$id") != "Remove template") {
 47+ if ($wgRequest->getVal("del_$id") != null) {
 48+ $deleted_template_loc = $id;
 49+ } else {
4850 $form_template = SFTemplateInForm::create($val,
4951 $wgRequest->getVal("label_$id"),
5052 $wgRequest->getVal("allow_multiple_$id"));
5153 $form_templates[] = $form_template;
52 - } else {
53 - $deleted_template_loc = $id;
5454 }
5555 }
5656 }
5757 }
58 - if ($wgRequest->getVal('add_field') == wfMsg('sf_createform_add')) {
 58+ if ($wgRequest->getVal('add_field') != null) {
5959 $form_template = SFTemplateInForm::create($wgRequest->getVal('new_template'), "", false);
6060 $new_template_loc = $wgRequest->getVal('before_template');
6161 # hack - array_splice() doesn't work for objects, so we have to

Status & tagging log