jslirola / flarum-ext-login2seeplus

This extension hides code, links and images in a post for visitors.
https://discuss.flarum.org/d/24193-login-2-see-plus
MIT License
6 stars 15 forks source link

Set exceeding length to 0 hides content from all users #20

Closed MattyWjeisz closed 1 year ago

MattyWjeisz commented 2 years ago

If setting 'exceeding limit' to 0, content is hidden from all users - including those logged in as well as administrators and moderators.

Noticed on Flarum 1.4.1 and PHP1.8.1.

screencapture-owdforum-d-1-owd-guidelines-2022-08-19-21_48_48

MattyWjeisz commented 2 years ago

Have also noticed same error even when setting exceed length to 1.

jslirola commented 2 years ago

I'm very busy these weeks, I'll try to take a look as soon as possible. Perhaps the problem is due to the last update of the extension, in the previous version it was working fine for you?

MattyWjeisz commented 2 years ago

I'm very busy these weeks, I'll try to take a look as soon as possible. Perhaps the problem is due to the last update of the extension, in the previous version it was working fine for you?

I've only run this extension on the latest version 1.4.1. so I haven't used an earlier version of the extension. If I knew more about it I'd try to find the problem for you, but coding isn't my strong suit unfortunately :(

jslirola commented 2 years ago

I'm not able to reproduce the issue unless the user's email isn't confirmed.

https://github.com/jslirola/flarum-ext-login2seeplus/blob/14257e206a02655732e03f989eef0516c8e5697b/src/HideContentInPosts.php#L24

Could you check your database and make sure the column is_email_confirmed is 1? Or edit the aboveline and replace it by:

if (!$serializer->getActor()->isGuest() /*&& $serializer->getActor()->is_email_confirmed === 1*/)
jslirola commented 1 year ago

Considering the time that has passed since it was reported and there have been no news or other users reporting this, I close the issue. If it happens again, we reopen it to continue the investigation.