Make WordPress Core


Ignore:
Timestamp:
07/01/2014 06:00:50 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Make wp_kses_no_null() remove any invalid control characters in a string.

props mauteri, miqrogroove.
fixes #28506.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r28845 r28942  
    992992
    993993/**
    994  * Removes any null characters in $string.
     994 * Removes any invalid control characters in $string.
     995 *
     996 * Also removes any instance of the '\0' string.
    995997 *
    996998 * @since 1.0.0
     
    10001002 */
    10011003function wp_kses_no_null($string) {
    1002     $string = preg_replace('/\0+/', '', $string);
     1004    $string = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $string);
    10031005    $string = preg_replace('/(\\\\0)+/', '', $string);
    10041006
Note: See TracChangeset for help on using the changeset viewer.