Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -514,6 +514,8 @@ |
515 | 515 | // Also replace periods with underlines, since that's what |
516 | 516 | // POST does to strings anyway. |
517 | 517 | $query_template_name = str_replace( '.', '_', $query_template_name ); |
| 518 | + // ...and escape apostrophes. |
| 519 | + $query_template_name = str_replace( "'", "\'", $query_template_name ); |
518 | 520 | // Cycle through the other components. |
519 | 521 | for ( $i = 2; $i < count( $tag_components ); $i++ ) { |
520 | 522 | $component = $tag_components[$i]; |
— | — | @@ -1372,17 +1374,15 @@ |
1373 | 1375 | $template_text .= SFFormUtils::addUnhandledFields( $template_name ); |
1374 | 1376 | } |
1375 | 1377 | $template_text .= "}}"; |
1376 | | - |
1377 | | - |
1378 | | - |
1379 | | - /*used on submission on the template form level |
1380 | | - 1. the base $template_text will contain strings like "@replace_xxx@" in the hidden fields when the form will be submitted |
1381 | | - on the following loops, the text for the multiple form templates is progressively reinserted in the main data, always keeping a trailing @replace_xxx@ for a given field |
1382 | | - the trailing @replace_xxx@ will be deleted at the end with the data from |
1383 | | - |
1384 | | - note: this clean up step could also be done with a regexp instead of keeping a track array /@replace_(.*)@/ |
1385 | | - */ |
1386 | | - |
| 1378 | + |
| 1379 | + // The base $template_text will contain strings like "@replace_xxx@" |
| 1380 | + // in the hidden fields when the form is submitted. |
| 1381 | + // On the following loops, the text for the multiple-instance templates |
| 1382 | + // is progressively reinserted in the main data, always keeping a |
| 1383 | + // trailing @replace_xxx@ for a given field |
| 1384 | + // The trailing @replace_xxx@ is then deleted at the end. |
| 1385 | + // Note: this cleanup step could also be done with a regexp, instead of |
| 1386 | + // keeping a track array (e.g., /@replace_(.*)@/) |
1387 | 1387 | $reptmp = self::makePlaceholderInWikiText( $curPlaceholder ); |
1388 | 1388 | if ( $curPlaceholder != null && $data_text && strpos( $data_text, $reptmp, 0 ) !== false) { |
1389 | 1389 | $data_text = preg_replace( '/' . $reptmp . '/', $template_text . $reptmp, $data_text ); |