Skip to content

Commit

Permalink
Simplified embedded media detection
Browse files Browse the repository at this point in the history
  • Loading branch information
cypnk authored May 22, 2024
1 parent 1574a0f commit 0309ec7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6530,10 +6530,10 @@ function embeds( string $html, string $prefix = '' ) : string {

if ( !isset( $media ) ) {
// Uploaded media embedding
$rx = '/(?:\[)(?<type>audio|video) ' .
'(?:(?:\[)(?<captions>.*?)(?:\])(?:\s+)?)?' .
'(?:\((?<preview>.*?)\)(?:\s+)?)?' .
'(?<src>[^\[]+)(?:\])/s';
$rx = '/\[(?<type>audio|video) ' .
'(?:\[(?<captions>(.*?))\]\s+?)?' .
'(?:\((?<preview>.*?)\)\s+?)?' .
'(?<src>[^\]]+)\]/s';

$media = [ $rx =>

Expand Down

0 comments on commit 0309ec7

Please sign in to comment.