litespeedtech / litespeedtech/lscache_wp
Undefined index: HTTP_REFERER - Problem with "Referrer-Policy" in .htaccess
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 257
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
I run in a problem when I use the "Purge All" feature from frontend. The site stops with a white screen.
The error is: `Undefined index: HTTP_REFERER` (/wordpress/wp-content/plugins/litespeed-cache/src/`admin.cls.php` on line 167) .... `wp_redirect( $_SERVER[ 'HTTP_REFERER' ] );`
**Reason for this error?**
For security I use an **.htaccess firwall**, which sets the "Referrer-Policy" to "no-referrer". Because of this, there is no HTTP_REFERER to redirect and the site stops with the Undefined index: HTTP_REFERER.
```
Header set Referrer-Policy "no-referrer"
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in wp-content/plugins/litespeed-cache/src/admin.cls.php at line 167 and reproduce the issue with the frontend “Purge All” feature while Referrer-Policy is set to no-referrer. Trace the redirect behavior when HTTP_REFERER is absent, then verify that the purge flow no longer ends in a white screen.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100