File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
lib/plugins/system/oembed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -44,18 +44,17 @@ function _getOembedIframe(oembed) {
4444 html = entities . decodeHTML ( html ) ;
4545 }
4646
47- var $container = cheerio . load ( '<div></div>' ) ( 'div' ) ;
47+ var $iframe = null ;
4848 try {
49- $container . html ( html ) ;
49+ var $iframe = cheerio . load ( html ) ( 'iframe' ) ;
5050 } catch ( ex ) { }
51- var $iframe = $container . find ( 'iframe' ) ;
5251
53- if ( $iframe . length === 2 && / < i f r a m e > $ / i. test ( html ) ) {
52+ if ( $iframe && $iframe . length === 2 && / < i f r a m e > $ / i. test ( html ) ) {
5453 // Forgive mis-closed iFrame tag
5554 $iframe = $iframe . first ( ) ;
5655 }
5756
58- if ( $iframe . length === 1 ) {
57+ if ( $iframe && $iframe . length === 1 ) {
5958 _iframe = fixOembedIframeAttributes ( $iframe [ 0 ] . attribs ) ;
6059 _iframe . placeholder = oembed . thumbnail_url ;
6160 }
You can’t perform that action at this time.
0 commit comments