Sanitize the whole class name

Data should be sanitized in whole not in part. Therefore the class prefix should be inside the function call.
This commit is contained in:
Ralf Wiechers 2017-08-29 12:32:32 +02:00 committed by GitHub
parent c29b9acb5b
commit 2fb700723f
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<dl class="variation">
<?php foreach ( $item_data as $data ) : ?>
<dt class="variation-<?php echo sanitize_html_class( $data['key'] ); ?>"><?php echo wp_kses_post( $data['key'] ); ?>:</dt>
<dd class="variation-<?php echo sanitize_html_class( $data['key'] ); ?>"><?php echo wp_kses_post( wpautop( $data['display'] ) ); ?></dd>
<dt class="<?php echo sanitize_html_class( 'variation-' . $data['key'] ); ?>"><?php echo wp_kses_post( $data['key'] ); ?>:</dt>
<dd class="<?php echo sanitize_html_class( 'variation-' . $data['key'] ); ?>"><?php echo wp_kses_post( wpautop( $data['display'] ) ); ?></dd>
<?php endforeach; ?>
</dl>