Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -438,13 +438,17 @@ |
439 | 439 | if ( array_key_exists( 0, $matches ) && array_key_exists( 1, $matches[0] ) ) { |
440 | 440 | $start_char = $matches[0][1]; |
441 | 441 | $fields_start_char = $start_char + 2 + strlen( $search_template_str ); |
442 | | - // skip ahead to the first real character |
443 | | - while ( in_array( $existing_page_content[$fields_start_char], array( ' ', '\n', '|' ) ) ) { |
| 442 | + // Skip ahead to the first real character. |
| 443 | + while ( in_array( $existing_page_content[$fields_start_char], array( ' ', '\n' ) ) ) { |
444 | 444 | $fields_start_char++; |
445 | 445 | } |
| 446 | + // If the next character is a pipe, skip that too. |
| 447 | + if( $existing_page_content[$fields_start_char] == '|' ) { |
| 448 | + $fields_start_char++; |
| 449 | + } |
446 | 450 | $template_contents = array( '0' => '' ); |
447 | | - // cycle through template call, splitting it up by pipes ('|'), |
448 | | - // except when that pipe is part of a piped link |
| 451 | + // Cycle through template call, splitting it up by pipes ('|'), |
| 452 | + // except when that pipe is part of a piped link. |
449 | 453 | $field = ""; |
450 | 454 | $uncompleted_square_brackets = 0; |
451 | 455 | $uncompleted_curly_brackets = 2; |
— | — | @@ -526,6 +530,7 @@ |
527 | 531 | if ( $all_values_for_template ) { |
528 | 532 | $cur_key = key( $all_values_for_template ); |
529 | 533 | // skip the input coming in from the "starter" div |
| 534 | + // TODO: this code is probably no longer necessary |
530 | 535 | if ( $cur_key == 'num' ) { |
531 | 536 | unset( $all_values_for_template[$cur_key] ); |
532 | 537 | $cur_key = key( $all_values_for_template ); |