r44403 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44402‎ | r44403 | r44404 >
Date:15:31, 10 December 2008
Author:yaron
Status:deferred
Tags:
Comment:
Re-added Li Ding's fix, this time with the bug (hopefully) removed
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc
@@ -448,6 +448,7 @@
449449 if ($field_name == 'free text' || $field_name = '<freetext>') {
450450 $free_text_preload_page = $sub_components[1];
451451 } else {
 452+ // this variable is not used
452453 $preload_page = $sub_components[1];
453454 }
454455 } elseif ($sub_components[0] == 'values') {
@@ -632,8 +633,12 @@
633634 // form values, see if the current input is part of that formula,
634635 // and if so, substitute in the actual value
635636 if ($form_submitted && $generated_page_name != '') {
636 - $true_input_name = str_replace('_', ' ', $input_name);
637 - $generated_page_name = str_ireplace("<$true_input_name>", $cur_value_in_template, $generated_page_name);
 637+ $generated_page_name = str_replace('.', '_', $generated_page_name);
 638+ $generated_page_name = str_replace(' ', '_', $generated_page_name);
 639+ $generated_page_name = str_ireplace("<$input_name>", $cur_value_in_template, $generated_page_name);
 640+ // once the substitution is done, replace underlines back
 641+ // with spaces
 642+ $generated_page_name = str_replace('_', ' ', $generated_page_name);
638643 }
639644 // disable this field if either the whole form is disabled, or
640645 // it's a restricted field and user doesn't have sysop privileges

Status & tagging log