Make WordPress Core


Ignore:
Timestamp:
09/14/2015 10:35:22 PM (11 years ago)
Author:
nbachiyski
Message:

Shortcodes: don't allow unclosed HTML elements in attributes

File:
1 edited

Legend:

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

    r33734 r34134  
    463463                                $atts[] = stripcslashes($m[8]);
    464464                }
     465
     466                // Reject any unclosed HTML elements
     467                foreach( $atts as &$value ) {
     468                        if ( false !== strpos( $value, '<' ) ) {
     469                                if ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) {
     470                                        $value = '';
     471                                }
     472                        }
     473                }
    465474        } else {
    466475                $atts = ltrim($text);
Note: See TracChangeset for help on using the changeset viewer.