Skip to content

Commit

Permalink
php - unescape slashes when output
Browse files Browse the repository at this point in the history
  • Loading branch information
froger-me committed Jan 11, 2024
1 parent 1c0117a commit 02597e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integration/dummy-generic/dummy-generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function dummy_generic_get_update_info() {
echo "---------\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
// Pretty print the response
echo json_encode( $info, JSON_PRETTY_PRINT ) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions.json_encode_json_encode
echo json_encode( $info, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions.json_encode_json_encode
echo "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
echo "The package is not installed\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Expand All @@ -141,7 +141,7 @@ function dummy_generic_update() {

echo "Updated\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo json_encode( json_decode( WPPUS_API::get_update_info(), true ), JSON_PRETTY_PRINT ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions.json_encode_json_encode
echo json_encode( json_decode( WPPUS_API::get_update_info(), true ), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions.json_encode_json_encode
} else {
echo "The package is not installed\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
Expand Down

0 comments on commit 02597e2

Please sign in to comment.