@@ 96-101 (lines=6) @@ | ||
93 | // use strict regex for digits + optional % instead of absint for height/width |
|
94 | // 'width' and 'height' params in the iframe url get the exact string from the shortcode |
|
95 | // args, whereas the inline style attribute must have "px" added to it if it has no "%" |
|
96 | if ( isset( $attributes['width'] ) && preg_match( "|^([0-9]+)(%)?$|", $attributes['width'], $matches ) ) { |
|
97 | $width = $csswidth = $attributes['width']; |
|
98 | if ( sizeof( $matches ) < 3 ) { |
|
99 | $csswidth .= "px"; |
|
100 | } |
|
101 | } |
|
102 | if ( isset( $attributes['height'] ) && preg_match( "|^([0-9]+)(%)?$|", $attributes['height'], $matches ) ) { |
|
103 | $height = $cssheight = $attributes['height']; |
|
104 | if ( sizeof( $matches ) < 3 ) { |
|
@@ 102-107 (lines=6) @@ | ||
99 | $csswidth .= "px"; |
|
100 | } |
|
101 | } |
|
102 | if ( isset( $attributes['height'] ) && preg_match( "|^([0-9]+)(%)?$|", $attributes['height'], $matches ) ) { |
|
103 | $height = $cssheight = $attributes['height']; |
|
104 | if ( sizeof( $matches ) < 3 ) { |
|
105 | $cssheight .= "px"; |
|
106 | } |
|
107 | } |
|
108 | ||
109 | if ( ! $height ) { |
|
110 | $height = $sizes[ $sizekey ]['height']; |