Make WordPress Core

Ticket #39778: 39778.diff

File 39778.diff, 1.1 KB (added by jonathanbardo, 8 years ago)
  • src/wp-includes/class-wp-customize-manager.php

    diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
    index 1b2d29dc3b..d6645c6e0f 100644
    final class WP_Customize_Manager { 
    480480                        return;
    481481                }
    482482
    483                 if ( ! preg_match( '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $this->_changeset_uuid ) ) {
     483                if ( ! wp_is_valid_uuid4( $this->_changeset_uuid ) ) {
    484484                        $this->wp_die( -1, __( 'Invalid changeset UUID' ) );
    485485                }
    486486
  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index 3923ca92ec..1762689c3c 100644
    function wp_generate_uuid4() { 
    56105610}
    56115611
    56125612/**
     5613 * Generate a random UUID (version 4).
     5614 *
     5615 * @param string $uuid
     5616 *
     5617 * @return bool The string is a valid UUID V4 or false on failure.
     5618 */
     5619function wp_is_valid_uuid4( $uuid ) {
     5620        return preg_match( '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $uuid );
     5621}
     5622
     5623/**
    56135624 * Get last changed date for the specified cache group.
    56145625 *
    56155626 * @since 4.7.0