Skip to content

Commit

Permalink
fixing change calc and table html entities output
Browse files Browse the repository at this point in the history
  • Loading branch information
elysium001 committed Sep 16, 2024
1 parent bd07479 commit f55d54f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ function convert_back_to_original_value( $val ): float {

// convert to float.
$val = str_replace( array( 's', 'ms', 'm', 'k', 'b', 't' ), '', strtolower( $val ) );

// convert number string with comma to float.
$val = str_replace( ',', '', $val );
$val = (float) $val;

// based on unit, try to convert value to float.
Expand Down
3 changes: 3 additions & 0 deletions src/class-json-to-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public function createTable(): void {
$slug = $val['slug'] ?? '';
}

// escape html entities.
$value = htmlspecialchars( $value );

$td = $this->table_html->createElement( 'td', "{$value}" );

// add inline style to cell.
Expand Down

0 comments on commit f55d54f

Please sign in to comment.