Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #43977, comment 2


Ignore:
Timestamp:
08/28/2018 02:31:57 PM (6 years ago)
Author:
flixos90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #43977, comment 2

    initial v1  
    33[attachment:"43977.2.diff"] is an update that outsources the relevant code into a new function: `wp_parse_list()` is similar to the existing `wp_parse_id_list()` and `wp_parse_slug_list()`, however without applying any additional sanitization on the list items.
    44
    5 The function contains the fix for `preg_split()` using the `PREG_SPLIT_NO_EMPTY` flag (good idea @sstoqnov!). There is one case where that flag doesn't really work though: If an empty string is passed to the function, the result will still be an array with one empty string in it, which is not what we want, so we need to work around it with an extra check.
     5The function contains the fix for `preg_split()` using the `PREG_SPLIT_NO_EMPTY` flag (good idea @sstoqnov!).
    66
    77`wp_parse_id_list()` and `wp_parse_slug_list()` now internally call `wp_parse_list()`.