|
@@ 133-138 (lines=6) @@
|
| 130 |
|
// use strict regex for digits + optional % instead of absint for height/width |
| 131 |
|
// 'width' and 'height' params in the iframe url get the exact string from the shortcode |
| 132 |
|
// args, whereas the inline style attribute must have "px" added to it if it has no "%" |
| 133 |
|
if ( isset( $attributes['width'] ) && preg_match( '|^([0-9]+)(%)?$|', $attributes['width'], $matches ) ) { |
| 134 |
|
$width = $csswidth = $attributes['width']; |
| 135 |
|
if ( sizeof( $matches ) < 3 ) { |
| 136 |
|
$csswidth .= 'px'; |
| 137 |
|
} |
| 138 |
|
} |
| 139 |
|
if ( isset( $attributes['height'] ) && preg_match( '|^([0-9]+)(%)?$|', $attributes['height'], $matches ) ) { |
| 140 |
|
$height = $cssheight = $attributes['height']; |
| 141 |
|
if ( sizeof( $matches ) < 3 ) { |
|
@@ 139-144 (lines=6) @@
|
| 136 |
|
$csswidth .= 'px'; |
| 137 |
|
} |
| 138 |
|
} |
| 139 |
|
if ( isset( $attributes['height'] ) && preg_match( '|^([0-9]+)(%)?$|', $attributes['height'], $matches ) ) { |
| 140 |
|
$height = $cssheight = $attributes['height']; |
| 141 |
|
if ( sizeof( $matches ) < 3 ) { |
| 142 |
|
$cssheight .= 'px'; |
| 143 |
|
} |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
if ( ! $height ) { |
| 147 |
|
$height = $sizes[ $sizekey ]['height']; |