Make WordPress Core


Ignore:
Timestamp:
09/18/2017 11:03:06 PM (8 years ago)
Author:
westonruter
Message:

Customize: Add wp_is_uuid() validation function with optional second $version=4 parameter to enforce v4 random UUIDs.

Props jonathanbardo.
Fixes #39778.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r41376 r41388  
    489489        }
    490490
    491         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 ) ) {
     491        if ( ! wp_is_uuid( $this->_changeset_uuid ) ) {
    492492            $this->wp_die( -1, __( 'Invalid changeset UUID' ) );
    493493        }
Note: See TracChangeset for help on using the changeset viewer.