Skip to content

Commit

Permalink
Fix escaped HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-mendonca committed Oct 11, 2022
1 parent cf1ea8d commit 6952d69
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions gp-templates/translation-row-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@

$missing_text = "<span class='missing'>$edit_text</span>";
if ( ! count( array_filter( $translation->translations, 'gp_is_not_null' ) ) ) {
echo esc_html( $missing_text );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $missing_text;
} elseif ( ! $translation->plural ) {
$singular_translation = esc_translation( $translation->translations[0] );
// Check if has root.
Expand All @@ -84,7 +85,8 @@
<small><?php esc_html_e( 'Singular:', 'glotpress' ); ?></small><br>
<?php
if ( ! isset( $translation->translations[0] ) || gp_is_empty_string( $translation->translations[0] ) ) {
echo esc_html( $missing_text );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $missing_text;
} else {
$singular_translation = esc_translation( $translation->translations[0] );
// Check if has root.
Expand All @@ -100,7 +102,8 @@
<small><?php esc_html_e( 'Plural:', 'glotpress' ); ?></small><br>
<?php
if ( ! isset( $translation->translations[1] ) || gp_is_empty_string( $translation->translations[1] ) ) {
echo esc_html( $missing_text );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $missing_text;
} else {
$singular_translation = esc_translation( $translation->translations[1] );
// Check if has root.
Expand Down Expand Up @@ -133,7 +136,8 @@
</small><br>
<?php
if ( ! isset( $translation->translations[ $plural_index ] ) || gp_is_empty_string( $translation->translations[ $plural_index ] ) ) {
echo esc_html( $missing_text );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $missing_text;
} else {
$plural_translation = esc_translation( $translation->translations[ $plural_index ] );
// Check if has root.
Expand Down

0 comments on commit 6952d69

Please sign in to comment.