-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
- I've read the Troubleshooting First Steps
- This request isn't a duplicate of an existing issue, opened or closed
- I've read the docs and followed them (if applicable)
- This is not a personal support request that should be posted on the YOURLS Discourse community
Describe the bug
Overruling yourls_is_private() is not possible anymore
To Reproduce
Steps to reproduce the behavior:
- Set
define( 'YOURLS_PRIVATE', true )anddefine( 'YOURLS_PRIVATE_INFOS', false ) - Open info page of a short url
- See that it's still private
Expected behavior
YOURLS_PRIVATE_INFOS and YOURLS_PRIVATE_API should have any effect.
Actual behavior
They don't have any effect.
Versions
1.8
Additional context
The problem is in here:
Lines 496 to 517 in 510851c
| function yourls_is_private() { | |
| $private = false; | |
| if ( defined( 'YOURLS_PRIVATE' ) && YOURLS_PRIVATE ) { | |
| $private = true; | |
| // Allow overruling for particular pages: | |
| // API | |
| if ( yourls_is_API() ) { | |
| if ( !defined( 'YOURLS_PRIVATE_API' ) || YOURLS_PRIVATE_API ) { | |
| $private = true; | |
| } | |
| } | |
| elseif ( yourls_is_infos() ) { | |
| if ( !defined( 'YOURLS_PRIVATE_INFOS' ) || YOURLS_PRIVATE_INFOS ) { | |
| $private = true; | |
| } | |
| // Others | |
| } | |
| } |
$private will always be true.
I will provide a pull request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working