Make WordPress Core

Changeset 42712 for trunk


Ignore:
Timestamp:
02/14/2018 11:45:56 AM (9 years ago)
Author:
SergeyBiryukov
Message:

Docs: Move inline comments in wp_kses_split2() before the blocks they apply to.

See #42505.

File:
1 edited

Legend:

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

    r42343 r42712  
    972972        $string = wp_kses_stripslashes( $string );
    973973
     974        // It matched a ">" character.
    974975        if ( substr( $string, 0, 1 ) != '<' ) {
    975976                return '&gt;';
    976977        }
    977         // It matched a ">" character
    978 
     978
     979        // Allow HTML comments.
    979980        if ( '<!--' == substr( $string, 0, 4 ) ) {
    980981                $string = str_replace( array( '<!--', '-->' ), '', $string );
    … …  
    991992                return "<!--{$string}-->";
    992993        }
    993         // Allow HTML comments
    994 
     994
     995        // It's seriously malformed.
    995996        if ( ! preg_match( '%^<\s*(/\s*)?([a-zA-Z0-9-]+)([^>]*)>?$%', $string, $matches ) ) {
    996997                return '';
    997998        }
    998         // It's seriously malformed
    999999
    10001000        $slash    = trim( $matches[1] );
    … …  
    10061006        }
    10071007
     1008        // They are using a not allowed HTML element.
    10081009        if ( ! isset( $allowed_html[ strtolower( $elem ) ] ) ) {
    10091010                return '';
    10101011        }
    1011         // They are using a not allowed HTML element
    1012 
     1012
     1013        // No attributes are allowed for closing elements.
    10131014        if ( $slash != '' ) {
    10141015                return "</$elem>";
    10151016        }
    1016         // No attributes are allowed for closing elements
    10171017
    10181018        return wp_kses_attr( $elem, $attrlist, $allowed_html, $allowed_protocols );
Note: See TracChangeset for help on using the changeset viewer.