tswaehn / phpmp

phpMp[v0.14.4] for PHP7.3
http://phpmpreloaded.sourceforge.net/
GNU General Public License v2.0
3 stars 1 forks source link

Not working with php7.1 #1

Closed Gerard64 closed 4 years ago

Gerard64 commented 4 years ago

[php7:error] [pid 610] [client 192.168.168.4:1679] PHP Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/html/sysadmin/phpmp/utils.php:14\nStack trace:\n#0 /var/www/html/sysadmin/phpmp/main.php(17): cleanSort(Array, Array)\n#1 /var/www/html/sysadmin/phpmp/index.php(287): include('/var/www/html/s...')\n#2 {main}\n thrown in /var/www/html/sysadmin/phpmp/utils.php on line 14, referer: https://test3.mydomain.tld/sysadmin/phpmp/index.php?body=main&server=0&sort=Artist,Composer,Performer,Track,Album,Track,Title,Time,Date,Genre&dir=2_Brothers_On_The_4th_Floor

I added: $new_sort_array = array(); On line 9 in utils.php This solved the problem.

Changed in PHP 7.1.0:

The empty index operator (e.g. $str[] = $x) is not supported for strings anymore, and throws a fatal error instead of silently converting to array.

So that means that you need to say that it is an array $myString = array(); Prior to PHP 7.1.0 , PHP converted a [] to array() silently, and now not anymore

tswaehn commented 4 years ago

@Gerard64 thank you, please check and close or let me know then I close for you :)

tswaehn commented 4 years ago

@Gerard64 please note that additional small changes were made to make it run on php7.3 if you find anything else that needs fixing, ... let me know :)

Gerard64 commented 4 years ago

I will download en start using the updated version soon. If i find a problem i will let you know. Thank you!