Skip to content

Commit d19b7a4

Browse files
committed
fix(phpstan): cast timestamp to string for esc_attr
DateTime::getTimestamp() returns int but esc_attr() expects string. Fixes PHPStan build-test failure.
1 parent 9018917 commit d19b7a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rt-plugin-report.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ private function render_table_row( $report ) {
537537
$time_update = new DateTime( $report['repo_info']->last_updated );
538538
$time_diff = human_time_diff( $time_update->getTimestamp(), current_time( 'timestamp' ) );
539539
$css_class = $this->get_timediff_risk_classname( current_time( 'timestamp' ) - $time_update->getTimestamp() );
540-
$html .= '<td class="' . $css_class . '" data-sort="' . esc_attr( $time_update->getTimestamp() ) . '">' . esc_html( $time_diff ) . '</td>';
540+
$html .= '<td class="' . $css_class . '" data-sort="' . esc_attr( (string) $time_update->getTimestamp() ) . '">' . esc_html( $time_diff ) . '</td>';
541541
} else {
542542
$html .= $this->render_error_cell();
543543
}

0 commit comments

Comments
 (0)