Skip to content

Commit 2c34a34

Browse files
committed
Fixed a bug introduced recently that was causing the (deprecated) tag generator to not work
1 parent 272dffb commit 2c34a34

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pdf-forms-for-contact-form-7.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,9 @@ private static function escape_tag_value($value)
13721372

13731373
/*
13741374
* Generates CF7 field tag based on field data
1375+
* $tagName must already be sanitized
13751376
*/
1376-
private static function generate_tag($field, $tagName)
1377+
private static function generate_tag( $field, $tagName )
13771378
{
13781379
$type = strval($field['type']);
13791380

@@ -1480,6 +1481,7 @@ private static function generate_tag($field, $tagName)
14801481
if( in_array( 'ReadOnly', $flags ) )
14811482
$tagOptions .= 'readonly ';
14821483
}
1484+
14831485
$unavailableNames = array(
14841486
'm','p','posts','w','cat','withcomments','withoutcomments'
14851487
,'s','search','exact','sentence','calendar','page','paged'
@@ -1489,12 +1491,13 @@ private static function generate_tag($field, $tagName)
14891491
,'attachment_id','subpost','subpost_id','preview','robots','taxonomy'
14901492
,'term','cpage','post_type','embed'
14911493
);
1492-
$tagName = sanitize_title( $tagName );
1493-
if( array_search( $tagName, $unavailableNames ) !== FALSE ){
1494+
if( array_search( $tagName, $unavailableNames ) !== FALSE )
1495+
{
14941496
$tagName .= '-0000';
14951497
do { $tagName++; }
14961498
while( array_search( $tagName, $unavailableNames ) !== FALSE );
14971499
}
1500+
14981501
return '[' . self::mb_trim( $tagType . ' ' . $tagName . ' ' . $tagOptions . $tagValues ) . ']';
14991502
}
15001503

0 commit comments

Comments
 (0)