Skip to content

Commit b4bc216

Browse files
committed
refactor: explicitly cast int variables to string on esc_attr() calls
1 parent a0d42e3 commit b4bc216

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

includes/class-scliveticker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ private static function tick_html( string $time, string $title, string $content,
441441
$content = do_shortcode( $content );
442442
}
443443

444-
return '<li class="sclt-tick" data-sclt-tick-id="' . esc_attr( $id ) . '">'
444+
return '<li class="sclt-tick" data-sclt-tick-id="' . esc_attr( (string) $id ) . '">'
445445
. '<span class="sclt-tick-time">' . esc_html( $time ) . '</span>'
446446
. '<span class="sclt-tick-title">' . esc_html( $title ) . '</span>'
447447
. '<div class="sclt-tick-content">' . $content . '</div></li>';
@@ -463,7 +463,7 @@ public static function tick_html_widget( string $time, string $title, bool $high
463463
$out .= ' class="sclt-widget-new"';
464464
}
465465
if ( $id > 0 ) {
466-
$out .= ' data-sclt-tick-id="' . esc_attr( $id ) . '"';
466+
$out .= ' data-sclt-tick-id="' . esc_attr( (string) $id ) . '"';
467467
}
468468
return $out . '>'
469469
. '<span class="sclt-widget-time">' . esc_html( $time ) . '</span>'

includes/class-widget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function widget( $args, $instance ) {
7878
echo ' sclt-ajax" '
7979
. 'data-sclt-ticker="' . esc_attr( $category ) . '" '
8080
. 'data-sclt-limit="' . esc_attr( $count ) . '" '
81-
. 'data-sclt-last="' . esc_attr( current_datetime()->getTimestamp() );
81+
. 'data-sclt-last="' . esc_attr( (string) current_datetime()->getTimestamp() );
8282
}
8383
echo '"><ul class="sclt-widget">';
8484

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
level: 4
2+
level: 5
33
paths:
44
- includes/
55
- stklcode-liveticker.php

0 commit comments

Comments
 (0)