Skip to content
Snippets Groups Projects
Commit 85e0a454 authored by Marcin Kolanko's avatar Marcin Kolanko
Browse files

fix: add missing escaping functions

parent cd630065
No related branches found
No related tags found
No related merge requests found
Pipeline #6166 passed
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
* @var string $value * @var string $value
*/ */
$header_size = $field->get_meta_value( 'header_size' ) ?: '2'; $header_size = (int) $field->get_meta_value( 'header_size' ) ?: 2;
$classes = $field->has_classes() ? 'class="' . $field->get_classes() . '"' : ''; $classes = $field->has_classes() ? 'class="' . esc_attr( $field->get_classes() ) . '"' : '';
?> ?>
<?php if ( $field->has_label() ): ?> <?php if ( $field->has_label() ): ?>
......
...@@ -13,11 +13,11 @@ $media_container_id = 'media_' . sanitize_key( $field->get_id() ); ...@@ -13,11 +13,11 @@ $media_container_id = 'media_' . sanitize_key( $field->get_id() );
id="<?php echo \esc_attr( $field->get_id() ); ?>"/> id="<?php echo \esc_attr( $field->get_id() ); ?>"/>
<div class="custom-img-container"> <div class="custom-img-container">
<?php if ( $value ) : ?> <?php if ( $value ) : ?>
<img src="<?php echo $value ?>" alt="" width="100"/> <img src="<?php echo \esc_html( $value ) ?>" alt="" width="100"/>
<?php endif; ?> <?php endif; ?>
</div> </div>
<p class="hide-if-no-js"> <p class="hide-if-no-js">
<a class="upload-custom-img <?php if ( $value ): ?>hidden<?php endif ?>" href="<?php echo $value ?>"> <a class="upload-custom-img <?php if ( $value ): ?>hidden<?php endif ?>" href="<?php echo \esc_html( $value ) ?>">
<?php _e( 'Set image', 'wp-forms' ) ?> <?php _e( 'Set image', 'wp-forms' ) ?>
</a> </a>
<a class="delete-custom-img <?php if ( ! $value ): ?>hidden<?php endif ?>" href="#"> <a class="delete-custom-img <?php if ( ! $value ): ?>hidden<?php endif ?>" href="#">
...@@ -28,7 +28,7 @@ $media_container_id = 'media_' . sanitize_key( $field->get_id() ); ...@@ -28,7 +28,7 @@ $media_container_id = 'media_' . sanitize_key( $field->get_id() );
<script> <script>
jQuery( function ( $ ) { jQuery( function ( $ ) {
var frame, var frame,
metaBox = $( '#<?php echo $media_container_id; ?>' ), metaBox = $( '#<?php echo esc_attr( $media_container_id ); ?>' ),
addImgLink = metaBox.find( '.upload-custom-img' ), addImgLink = metaBox.find( '.upload-custom-img' ),
delImgLink = metaBox.find( '.delete-custom-img' ), delImgLink = metaBox.find( '.delete-custom-img' ),
imgContainer = metaBox.find( '.custom-img-container' ), imgContainer = metaBox.find( '.custom-img-container' ),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment