Skip to content

Commit 5461d00

Browse files
committed
fix(renderer): escape GeoJSON property values in infowindow output
1 parent 7bef882 commit 5461d00

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

includes/renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class="draad-maps__dataset"
371371
continue;
372372
}
373373

374-
$infowindowContent .= '<tr><th>'. $row['label'] .'</th><td>'. $feature['properties'][ $row['key'] ] .'</td></tr>';
374+
$infowindowContent .= '<tr><th>' . esc_html( $row['label'] ) . '</th><td>' . esc_html( $feature['properties'][ $row['key'] ] ) . '</td></tr>';
375375
}
376376
$infowindowContent .= '</table>';
377377

@@ -395,7 +395,7 @@ class="draad-maps__item draad-card draad-card--infowindow"
395395
if ( is_iterable( $infowindowContentRows ) && !empty( $infowindowContentRows ) ) {
396396
$infowindow .= '<div class="draad-card__wrapper">
397397
<div class="draad-card__content">';
398-
$infowindow .= ( $title ) ? '<h3 class="draad-card__title">' . $title . '</h3>' : '';
398+
$infowindow .= ( $title ) ? '<h3 class="draad-card__title">' . esc_html( $title ) . '</h3>' : '';
399399
$infowindow .= ( $infowindowContent ) ? '<div class="draad-card__description">' . $infowindowContent . '</div>' : '';
400400
$infowindow .= '</div>
401401
</div>

0 commit comments

Comments
 (0)