[wp-trac] [WordPress Trac] #64480: WordPress PHP Deprecated: Implicit conversion from float 44.168

WordPress Trac noreply at wordpress.org
Fri Jan 9 17:31:13 UTC 2026


#64480: WordPress PHP Deprecated: Implicit conversion from float 44.168
-------------------------------+------------------------------
 Reporter:  sotnas             |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  6.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by sabernhardt):

 Could the site have an SVG attachment with 44.168 as the width or a value
 in the `viewBox` attribute?

 [https://plugins.trac.wordpress.org/browser/safe-svg/trunk/safe-
 svg.php?marks=665-689#L660 Safe SVG] uses `floatval()` to set dimensions
 for SVG, but it gave me integers when I tried uploading the following
 graphics:
 {{{
 1. viewBox-20.2x20-safe.svg
    dimensions: 20 × 20, from viewBox
 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20.2 20"><circle
 cx="7" cy="7" r="5"/><circle cx="9" cy="9" r="5"/></svg>

 2. 20.2w20h-safe.svg
    dimensions: 202 × 200, from viewBox
 <svg xmlns="http://www.w3.org/2000/svg" width="20.2" height="20"
 viewBox="0 0 202 200"><circle cx="100" cy="100" r="100"/></svg>

 3. 20.2w20h-safe2.svg
    dimensions: 20 × 20, from width and height attributes because I used
    add_filter( 'safe_svg_use_width_height_attributes', '__return_true' );
 <svg xmlns="http://www.w3.org/2000/svg" width="20.2" height="20"
 viewBox="0 0 202 200"><circle cx="100" cy="100" r="100"/></svg>
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64480#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list