@@ 671-683 (lines=13) @@ | ||
668 | } |
|
669 | ||
670 | // If there is a width in the style attributes: |
|
671 | if (isset($attributes['width']) and $width == -1) { |
|
672 | // check that the last two characters are px (pixels) |
|
673 | if (strtolower(substr($attributes['width'], -2)) == 'px') { |
|
674 | $proposed_width = substr($attributes['width'], 0, -2); |
|
675 | // Now make sure that it's an integer and not something stupid. |
|
676 | if (filter_var($proposed_width, FILTER_VALIDATE_INT)) { |
|
677 | $width = $proposed_width; |
|
678 | } |
|
679 | } |
|
680 | } |
|
681 | ||
682 | // If there is a width in the style attributes: |
|
683 | if (isset($attributes['height']) and $height == -1) { |
|
684 | // check that the last two characters are px (pixels) |
|
685 | if (strtolower(substr($attributes['height'], -2)) == 'px') { |
|
686 | $proposed_height = substr($attributes['height'], 0, -2); |
|
@@ 683-695 (lines=13) @@ | ||
680 | } |
|
681 | ||
682 | // If there is a width in the style attributes: |
|
683 | if (isset($attributes['height']) and $height == -1) { |
|
684 | // check that the last two characters are px (pixels) |
|
685 | if (strtolower(substr($attributes['height'], -2)) == 'px') { |
|
686 | $proposed_height = substr($attributes['height'], 0, -2); |
|
687 | // Now make sure that it's an integer and not something stupid. |
|
688 | if (filter_var($proposed_height, FILTER_VALIDATE_INT)) { |
|
689 | $height = $proposed_height; |
|
690 | } |
|
691 | } |
|
692 | } |
|
693 | ||
694 | } |
|
695 | ||
696 | $result = [ |
|
697 | 'height' => $height, |
|
698 | 'width' => $width, |