Make WordPress Core

Changeset 34377


Ignore:
Timestamp:
09/22/2015 04:30:11 AM (9 years ago)
Author:
wonderboymusic
Message:

Sanitization: when falling back to (wait for it...) $fallback in sanitize_html_class(), sanitize it as well.

Props MikeHansenMe, wonderboymusic.
Fixes #30967.

File:
1 edited

Legend:

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

    r34277 r34377  
    16011601    $sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized );
    16021602
    1603     if ( '' == $sanitized )
    1604         $sanitized = $fallback;
    1605 
     1603    if ( '' == $sanitized && $fallback ) {
     1604        return sanitize_html_class( $fallback );
     1605    }
    16061606    /**
    16071607     * Filter a sanitized HTML class string.
Note: See TracChangeset for help on using the changeset viewer.