WordPress.org

Make WordPress Core

Changes between Version 5 and Version 6 of Ticket #46188, comment 2


Ignore:
Timestamp:
02/05/2019 03:09:32 PM (19 months ago)
Author:
KestutisIT
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #46188, comment 2

    v5 v6  
    22> What about using `esc_textarea()` or hooking into the `esc_html` filter instead?
    33
    4 I'm not sure if filter-hook is good decision. As this has to be global for all plugin developers, meaning a standard defined in coding standards,
     4I'm not sure if filter-hook is good decision. As this has to be global for all plugin developers, meaning a standard defined in coding standards.
    55
    6 What I did not, is that I created a 'fake' formating.php file in my plugin to replicate the missing lines on \wp-includes\formatting.php:
     6What I did, is that I created a 'fake' formating.php file in my plugin folder to replicate the missing lines of code in `\wp-includes\formatting.php`:
    77
    8 PATCH could be the following for the \wp-includes\formatting.php file:
     8PATCH could be the following for the `\wp-includes\formatting.php` file:
    99
    1010{{{#!php
     
    3131}}}
    3232
    33 Regarding the `esc_textarea` - that would be a **BAD** decision, as it impacts all the other chars, it is dedicated to use inside `<textarea>` HTML tag, and probably `esc_textarea` does not escapes single quotes. I mean the same title with just the need of span in via multiple lines is so much common case that I saw it over 1000 times in recent years, but only now everybody is bumping so much to the standards, so we need to finally make a solution for everybody, so I believe we need to add one more function to wp-includes\formatting.php or to add an additional parameter support to `esc_html`.
     33Regarding the `esc_textarea` - that would be a **BAD** decision, as it impacts all the other chars, it is dedicated to use inside `<textarea>` HTML tag, and probably `esc_textarea` does not escapes single quotes. I mean the same title with just the need of span in via multiple lines is so much common case that I saw it over 1000 times in recent years, but only now everybody is bumping so much to the standards, so we need to finally make a solution for everybody, so I believe we need to add one more function to `\wp-includes\formatting.php` or to add an additional parameter support to `esc_html`.