fix: escape ticker ID in shortcode output (#28)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Ticker ID is user input and may contain literally anything. While this is properly escaped in the internal query, we should also escape it in the generated HTML output.
This commit is contained in:
parent
4635a47ca9
commit
fceea65dfb
@ -232,7 +232,7 @@ class SCLiveticker {
|
|||||||
$output = '<div class="wp-block-scliveticker-ticker';
|
$output = '<div class="wp-block-scliveticker-ticker';
|
||||||
if ( 1 === self::$options['enable_ajax'] ) {
|
if ( 1 === self::$options['enable_ajax'] ) {
|
||||||
$output .= ' sclt-ajax" '
|
$output .= ' sclt-ajax" '
|
||||||
. 'data-sclt-ticker="' . $ticker . '" '
|
. 'data-sclt-ticker="' . esc_attr( $ticker ) . '" '
|
||||||
. 'data-sclt-limit="' . $limit . '" '
|
. 'data-sclt-limit="' . $limit . '" '
|
||||||
. 'data-sclt-last="' . $last;
|
. 'data-sclt-last="' . $last;
|
||||||
}
|
}
|
||||||
@ -242,9 +242,9 @@ class SCLiveticker {
|
|||||||
if ( $show_feed ) {
|
if ( $show_feed ) {
|
||||||
$feed_link = get_post_type_archive_feed_link( 'scliveticker_tick' ) . '';
|
$feed_link = get_post_type_archive_feed_link( 'scliveticker_tick' ) . '';
|
||||||
if ( false === strpos( $feed_link, '&' ) ) {
|
if ( false === strpos( $feed_link, '&' ) ) {
|
||||||
$feed_link .= '?scliveticker_ticker=' . $ticker;
|
$feed_link .= '?scliveticker_ticker=' . rawurlencode( $ticker );
|
||||||
} else {
|
} else {
|
||||||
$feed_link .= '&scliveticker_ticker=' . $ticker;
|
$feed_link .= '&scliveticker_ticker=' . rawurlencode( $ticker );
|
||||||
}
|
}
|
||||||
$output .= '<a href="' . esc_attr( $feed_link ) . '">Feed</a>';
|
$output .= '<a href="' . esc_attr( $feed_link ) . '">Feed</a>';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user