[wp-trac] [WordPress Trac] #50867: An API which encourages automatic escaping of HTML

WordPress Trac noreply at wordpress.org
Fri Aug 7 02:01:26 UTC 2020


#50867: An API which encourages automatic escaping of HTML
-------------------------------------------------+-------------------------
 Reporter:  noisysocks                           |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:
  docs dev-feedback 2nd-opinion                  |
-------------------------------------------------+-------------------------

Comment (by noisysocks):

 To better illustrate this proposal, I rewrote
 `render_block_core_navigation_link` using `wp_el`. You can see how that
 looks here:

 https://github.com/WordPress/gutenberg/compare/try/refactor-navigation-
 link-render_callback

 ----

 Replying to [comment:5 johnbillion]:
 > Is there existing precedent for this in the wider PHP ecosystem? Any
 existing libraries that we can utilise or get inspiration from?
 I suppose it's more common in other PHP codebases to use a templating
 language. See #33472. It's a much more heavyweight solution, though. I
 like that this proposal is optional: another tool to go into a developer's
 toolbox.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50867#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list