Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 Compatibility #68

Open
claytonk opened this issue Oct 19, 2022 · 6 comments
Open

PHP 8 Compatibility #68

claytonk opened this issue Oct 19, 2022 · 6 comments

Comments

@claytonk
Copy link

If anyone is still maintaining this, there are a couple updates required to make this script compatible with PHP 8:

In the snippet "FileDownload" line 673 contains a create_function call which is deprecated:

array_walk($scriptProperties, create_function('&$val', 'if (!is_array($val)) $val = trim($val);'));

This can be changed to:

array_walk($scriptProperties, function(&$val){if (!is_array($val)){ $val = trim($val); }});

In model/php5-utf8/UTF8.php there are two issues that need fixing:

inline '#' comments need to be changed to '//'
all curly bracket references to characters within in a string such as: $char{1} need to be changed to $char[1]

With these changes it appears to work in PHP8

@unze
Copy link

unze commented Nov 18, 2022

Can you upload the changed files please?

@claytonk
Copy link
Author

claytonk commented Nov 18, 2022

updates.zip

This zip contains the updated filedownload snippet and the UTF8.php script. I can't edit the source on the repository, I'm not the owner, and I don't know if anyone is maintaining it. It looks like it's been inactive for 7 years.

@unze
Copy link

unze commented Nov 20, 2022

thanks for uploading, unfortunately does not work for me with php 8.0 or 8.1

@claytonk
Copy link
Author

claytonk commented Nov 20, 2022 via email

@unze
Copy link

unze commented Nov 21, 2022

Unfortunately, even with the setting to output errors with E_ALL only a white page is displayed and also in the apache2 error.log there are no entries

@Jako
Copy link

Jako commented May 3, 2023

Please check the version 3.0.0 on the MODX repository and on this fork: https://github.com/Jako/FileDownloadR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants