Xenthys / ShareXen

ShareXen - Another ShareX Custom Uploader PHP Script
MIT License
102 stars 22 forks source link

No support for PHP 8.0+ #21

Closed DarkerMatter closed 2 years ago

DarkerMatter commented 2 years ago

After running a light speed web server with php 8 and ShareXen, API info calls could not be made (example here: https://bsh4.com/gt25ic8.png) The solution was downgrading to php 7.4

Xenthys commented 2 years ago

Thank you for opening an issue as requested, it appears PHP array_map wants a string containing the function name instead of the function itself. I believe PHP 7 is more lenient so it never caused any issue… until now.

Could you replace this line:

$data['users'] = array_map(strval, array_keys(USERS));

By this one please, I just added quotation marks around strval:

$data['users'] = array_map('strval', array_keys(USERS));

Once done, I invite you to switch back to PHP 8.0+ and let me know if it works, I can't test it right now.

Thank you in advance for your cooperation!