Skip to content

Commit

Permalink
Fix "All output should be run through an escaping function".
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed May 15, 2024
1 parent a903388 commit 754b9da
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ private static function parse_int( $value ) {
throw new \InvalidArgumentException(
\sprintf(
'Number::parse_int() function only accepts integers. Input was: %s',
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
\var_export( $value, true )
\esc_html( \wp_json_encode( $value ) )
)
);
}
Expand All @@ -366,8 +365,7 @@ private static function parse_float( $value ) {
throw new \InvalidArgumentException(
\sprintf(
'Number::from_float() function only accepts floats. Input was: %s',
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
\var_export( $value, true )
\esc_html( \wp_json_encode( $value ) )
)
);
}
Expand Down Expand Up @@ -442,7 +440,7 @@ private static function parse_string( $value ) {
throw new \InvalidArgumentException(
\sprintf(
'No numerical value: %s.',
$value
\esc_html( $value )
)
);
}
Expand Down Expand Up @@ -475,7 +473,7 @@ private static function parse_mixed( $value ) {
throw new \InvalidArgumentException(
\sprintf(
'Unsupported type, input was of type: %s.',
\gettype( $value )
\esc_html( \gettype( $value ) )
)
);
}
Expand Down

0 comments on commit 754b9da

Please sign in to comment.