Why exactly? You can see the added <!β html is corrupted β> at above example-links. These are standard WordPress REST-API links, more here.
-
This reply was modified 9 years, 3 months ago by
ov3rfly.
because I wanna fix the problem with you.
No further input is necessary, testcases are right there on your server.
Spent already enough time on this before I saw that added html-comment…
Thanks for quick feedback and the plugin.
ok π I will fix and let you know.
you can exclude the api url as below.

Thanks for quick workaround.
This should be fixed in a general way though, just think of other endpoints, anything can be there, see also register_rest_route().
Now I added a feature which excludes the url which start with /wp-json. Is it enough?
Not enough, latest Contact Form 7 uses /contact-forms as an endpoint. And others will follow.
Real fix: Do not add HTML-comments to non-HTML data.
Not enough, latest Contact Form 7 uses /contact-forms as an endpoint. And others will follow.
Can you tell me the url please?
Real fix: Do not add HTML-comments to non-HTML data.
It makes the debug easier.
Can you tell me the url please?
https://ww.wp.xz.cn/plugins/contact-form-7/
It makes the debug easier.
And it breaks REST-API endpoints.
See also here, this has been a problem for others as well:
We should move step by step. Can you show me a sample url for “/contact-forms as an endpoint”?
See here: .../contact-form-7/includes/rest-api.php
But comparing strings in URLs is not an option, anything can be an endpoint, see register_rest_route() docs, linked above.
Real fix: Do not add HTML-comments to non-HTML data.
For debug try something like this:
if ( WP_DEBUG ) error_log( 'WPFC: <!β html is corrupted β>' );
You are right but I cannot detect the json pages sometimes with $_SERVER[“HTTP_ACCEPT”].