Stabilize WAF Compatibility #5059
Labels
Group: Integration
Integration with other platforms and plugins
Group: WordPress
Changes related to WordPress or Gutenberg integration
P1
High priority, must do soon
Type: Enhancement
New feature or improvement of an existing feature
Feature Description
This ticket is two-fold:
Preventing issues with HTML markup in REST API requests
On one hand, This is a follow-up to #4805 to make the feature stable and remove the experimental flag.
One reason why the current method is experimental is because it uses
mb_convert_encoding
with UTF-16, which might not be available on all sites (the polyfill only handles UTF-8 well).I think we can make this much, much simpler by not using Base64 and instead simply replace all
>
and<
characters with placeholders over the wire. This should help prevent WAF issues.For example,
<
could be replaced with__WEB_STORIES_LT__
, and>
with__WEB_STORIES_GT__
Example code:
Result:
Of course there could be other ways too.
Preventing other issues with WAFs
Prevent conflicts in other areas, like HTTP request methods or other blocks, as done in #5120.
Alternatives Considered
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance Criteria
Implementation Brief
The text was updated successfully, but these errors were encountered: