Changeset 47122 for trunk/src/wp-includes/class-wp-oembed.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-oembed.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-oembed.php
r47101 r47122 263 263 list( $providerurl, $regex ) = $data; 264 264 265 // Turn the asterisk-type provider URLs into regex 265 // Turn the asterisk-type provider URLs into regex. 266 266 if ( ! $regex ) { 267 267 $matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i'; … … 270 270 271 271 if ( preg_match( $matchmask, $url ) ) { 272 $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML 272 $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML. 273 273 break; 274 274 } … … 440 440 $args = apply_filters( 'oembed_remote_get_args', $args, $url ); 441 441 442 // Fetch URL content 442 // Fetch URL content. 443 443 $request = wp_safe_remote_get( $url, $args ); 444 444 $html = wp_remote_retrieve_body( $request ); … … 463 463 ); 464 464 465 // Strip <body> 465 // Strip <body>. 466 466 $html_head_end = stripos( $html, '</head>' ); 467 467 if ( $html_head_end ) { … … 469 469 } 470 470 471 // Do a quick check 471 // Do a quick check. 472 472 $tagfound = false; 473 473 foreach ( $linktypes as $linktype => $format ) { … … 485 485 $providers[ $linktypes[ $atts['type'] ] ] = htmlspecialchars_decode( $atts['href'] ); 486 486 487 // Stop here if it's JSON (that's all we need) 487 // Stop here if it's JSON (that's all we need). 488 488 if ( 'json' == $linktypes[ $atts['type'] ] ) { 489 489 break; … … 494 494 } 495 495 496 // JSON is preferred to XML 496 // JSON is preferred to XML. 497 497 if ( ! empty( $providers['json'] ) ) { 498 498 return $providers['json'];
Note: See TracChangeset
for help on using the changeset viewer.