Quantcast
Viewing all articles
Browse latest Browse all 294800

[PHP 8] Error: TypeError: round() in parse_size function

Problem/Motivation

When using parse_size function, if we dont provide units, call to round fails, since we are providing string from preg_replace
TypeError: round(): Argument #1 ($num) must be of type int|float, string given in function round() (line: 1925 in file /includes/common.inc).

Steps to reproduce

1) Content with image field.
2) Media Browser widgeton that field.
3) Use 'Browse' button when creating content.

Proposed resolution

Typecast string to float.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None


Viewing all articles
Browse latest Browse all 294800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>