r40306 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40305‎ | r40306 | r40307 >
Date:15:21, 1 September 2008
Author:yaron
Status:old
Tags:
Comment:
Added handling for HTML-encoded pipes, not just curly brackets
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc
@@ -172,11 +172,11 @@
173173 $free_text_was_included = false;
174174 $free_text_preload_page = null;
175175 $all_values_for_template = array();
176 - // replace HTML-encoded representations of curly brackets with actual
177 - // curly brackets - this is a hack to allow for forms to include
178 - // templates that themselves contain form elements - the escaping is
179 - // needed to make sure that those elements don't get parsed too early
180 - $form_def = str_replace(array('{', '}'), array('{', '}'), $form_def);
 176+ // unencode and HTML-encoded representations of curly brackets and
 177+ // pipes - this is a hack to allow for forms to include templates
 178+ // that themselves contain form elements - the escaping is needed
 179+ // to make sure that those elements don't get parsed too early
 180+ $form_def = str_replace(array('{', '|', '}'), array('{', '|', '}'), $form_def);
181181 while ($brackets_loc = strpos($form_def, "{{{", $start_position)) {
182182 $brackets_end_loc = strpos($form_def, "}}}", $brackets_loc);
183183 $bracketed_string = substr($form_def, $brackets_loc + 3, $brackets_end_loc - ($brackets_loc + 3));

Status & tagging log