SS88UK / roundcube-easy-unsubscribe

Displays a small icon after the subject line when viewing an email, so you can very quickly unsubscribe.
MIT License
13 stars 7 forks source link

Warnings with PHP 8.2.15 #6

Closed emtiu closed 9 months ago

emtiu commented 9 months ago

Hi, thanks for the great plugin :) I'm seeing warnings in my logs when using it with PHP 8.2.15:

PHP Deprecated: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in /[…]/Roundcube/plugins/easy_unsubscribe/easy_unsubscribe.php on line 32
PHP Warning: Undefined array key "list-unsubscribe" in /[…]/Roundcube/plugins/easy_unsubscribe/easy_unsubscribe.php on line 31
SS88UK commented 9 months ago

Thanks for spotting this @emtiu! Fixed.

emtiu commented 9 months ago

Thank you for responding so quickly. I'd like to test the updated code, but I find that I can't get the latest version through composer. I've tried a million ways, but composer only ever installs d09f4428aeb6763dd4110a59e32cfcb231174c8b, which is from 2019.

I have no idea why this happens. https://plugins.roundcube.net/#/packages/ss88/easy_unsubscribe and https://packagist.org/packages/ss88/easy_unsubscribe list the correct information (meaning: 3970c082f61c1bfbcad04fb86f881aab62189499 as the latest commit of dev-master).

From investigating composer's -vvv output, it see to me that the contents of https://repo.packagist.org/p2/ss88/easy_unsubscribe.json are empty/malformed. I have no idea what that means.

emtiu commented 9 months ago

Aha! I was looking at the wrong file when I investigated https://repo.packagist.org/p2/ss88/easy_unsubscribe.json – that's just for stable versions, which roundcube-easy-unsubscribe doesn't have.

Here's where it gets interesting: composer pulls https://repo.packagist.org/p2/ss88/easy_unsubscribe~dev.json, which has the correct most current commit listed.

However, it also pulls https://plugins.roundcube.net/p/ss88/easy_unsubscribe%243eca1312a1595c6ebfe5e178c043d8ac8348a541df6381c8a9aea41b9f62b0d9.json, and that's stuck on d09f442 from 2019.

What's weird is that https://plugins.roundcube.net/#/packages/ss88/easy_unsubscribe and https://plugins.roundcube.net/p/ss88/easy_unsubscribe%243eca1312a1595c6ebfe5e178c043d8ac8348a541df6381c8a9aea41b9f62b0d9.json disagree, but I guess that the latter one is the one that counts.

emtiu commented 9 months ago

In any case, the warnings are gone when I manually shove the latest code into my Roundcube installation ;D

I'm making the composer problem into a new issue, so we don't get confused ;)