Make WordPress Core

Ticket #31212: fix-31212.diff

File fix-31212.diff, 786 bytes (added by cweiske, 9 years ago)

Patch that fixes the problem.

  • src/wp-includes/class-oembed.php

    commit 92e569c4c404860f78970b00c418c3e1bc4fe57c
    Author: Christian Weiske <cweiske@cweiske.de>
    Date:   Mon Feb 2 20:47:46 2015 +0100
    
        Fix oEmbed discovery on XHTML pages
        
        Strip trailing slash on empty (self-closing) link elements to
        make `shortcode_parse_atts` work.
        
        Fixes #31212.
    
    diff --git src/wp-includes/class-oembed.php src/wp-includes/class-oembed.php
    index e5bc4a7..34919fc 100644
    class WP_oEmbed { 
    347347                                }
    348348                        }
    349349
    350                         if ( $tagfound && preg_match_all( '/<link([^<>]+)>/i', $html, $links ) ) {
     350                        if ( $tagfound && preg_match_all( '#<link([^<>]+)/?>#iU', $html, $links ) ) {
    351351                                foreach ( $links[1] as $link ) {
    352352                                        $atts = shortcode_parse_atts( $link );
    353353