Bug(AndFix)Report: 'Unsupported operand types: string / int'

Phoca Download - download manager
HueNa
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 20 Jul 2011, 05:14

Bug(AndFix)Report: 'Unsupported operand types: string / int'

Post by HueNa »

Hello,

After I updated the PHP from Version 7.4.33 to Version 8.0.25,
I come to get 'Unsupported operand types: string / int' error when I select a file from backend.

I'm using Joomla! 3.10.11 and PhocaDownload Version 3.2.3.

The Error is raised at /administrator/components/com_phocadownload/libraries/phocadownload/file/file.php:32.
I could fix the error by replacing the line,
from

Code: Select all

if ($sizestring != $lastsizestring) { $size /= 1024; }
to

Code: Select all

if ($sizestring != $lastsizestring) { $size = intval($size) / 1024; }
If this fix is adequate, please adopt it to the next version.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48536
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug(AndFix)Report: 'Unsupported operand types: string / int'

Post by Jan »

Hi, thank you for the info, yes, there can be int instead of intval.

I will set it in next version.

Thank you, Jan
If you find Phoca extensions useful, please support the project
Post Reply