gocodebox / gocodebox/lifterlms

Search is accessible when site is restricted to a membership

Open
#1,262 0 comments 0 reactions 1 assignee Claimed by @thomasplevy View on GitHub
Severity: Normal Status: Has PR Type: Bug
Dominant language
PHP
Stars
212
Forks
140
Avg merge
2d 14h
Merged PRs (30d)
19

Description

### Reproduction Steps

+ Create a membership
+ Set the site to be restricted to this membership via the "Restrict site by membership level" global setting
+ As a logged out user visit the search page for the site (append ?s=whatever to the site's home url)

### Expected Behavior

+ Visitor will be served the sitewide restriction notice / redirect / etc...

### Actual Behavior

+ User can see search results

### Error Messages / Logs

N/A

### System and Environment Information

System Report

```
LifterLMS 4.3.0, this will likely happen on 3.16 or later (possibly earlier)
```

This issue has be recreated:
+ [x] Locally
+ [ ] On a staging site
+ [ ] On a production website
+ [x] With only LifterLMS and a default theme

### Additional Information and Context

I believe this is a bug because we have explicit logic in place to *allow* searching when a sitewide restriction is NOT enabled

https://github.com/gocodebox/lifterlms/blob/64622439a618aca8be8829eaf499a413bac317c1/includes/functions/llms.functions.access.php#L54-L56

However there's no inverse logic to serve a restriction when searching and sitewide membership *is* enabled.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.