@@ -1372,8 +1372,9 @@ private static function escape_tag_value($value)
1372
1372
1373
1373
/*
1374
1374
* Generates CF7 field tag based on field data
1375
+ * $tagName must already be sanitized
1375
1376
*/
1376
- private static function generate_tag ($ field , $ tagName )
1377
+ private static function generate_tag ( $ field , $ tagName )
1377
1378
{
1378
1379
$ type = strval ($ field ['type ' ]);
1379
1380
@@ -1480,6 +1481,7 @@ private static function generate_tag($field, $tagName)
1480
1481
if ( in_array ( 'ReadOnly ' , $ flags ) )
1481
1482
$ tagOptions .= 'readonly ' ;
1482
1483
}
1484
+
1483
1485
$ unavailableNames = array (
1484
1486
'm ' ,'p ' ,'posts ' ,'w ' ,'cat ' ,'withcomments ' ,'withoutcomments '
1485
1487
,'s ' ,'search ' ,'exact ' ,'sentence ' ,'calendar ' ,'page ' ,'paged '
@@ -1489,12 +1491,13 @@ private static function generate_tag($field, $tagName)
1489
1491
,'attachment_id ' ,'subpost ' ,'subpost_id ' ,'preview ' ,'robots ' ,'taxonomy '
1490
1492
,'term ' ,'cpage ' ,'post_type ' ,'embed '
1491
1493
);
1492
- $ tagName = sanitize_title ( $ tagName );
1493
- if ( array_search ( $ tagName , $ unavailableNames ) !== FALSE ) {
1494
+ if ( array_search ( $ tagName, $ unavailableNames ) !== FALSE )
1495
+ {
1494
1496
$ tagName .= '-0000 ' ;
1495
1497
do { $ tagName ++; }
1496
1498
while ( array_search ( $ tagName , $ unavailableNames ) !== FALSE );
1497
1499
}
1500
+
1498
1501
return '[ ' . self ::mb_trim ( $ tagType . ' ' . $ tagName . ' ' . $ tagOptions . $ tagValues ) . '] ' ;
1499
1502
}
1500
1503
0 commit comments