Skip to content

Commit

Permalink
fix phpcs issue on fix/75-slow-load-times-due-to-svgdimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
sksaju committed Nov 27, 2023
1 parent daadc14 commit cede2e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions safe-svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public function metadata_error_fix( $data, $post_id ) {
/**
* Get SVG size from the width/height or viewport.
*
* @param string|false $svg The file path to where the SVG file should be, false otherwise.
* @param integer $attachment_id The attachment ID of the SVG being processed.
*
* @return array|bool
*/
Expand Down Expand Up @@ -594,7 +594,7 @@ protected function svg_dimensions( $attachment_id ) {
if ( $svg && ! empty( $metadata['width'] ) && empty( $metadata['height'] ) ) {
$width = floatval( $metadata['width'] );
$height = floatval( $metadata['height'] );
} else if ( $svg ) {
} elseif ( $svg ) {
$svg = @simplexml_load_file( $svg ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged

$attributes = $svg->attributes();
Expand Down

0 comments on commit cede2e8

Please sign in to comment.