Repository navigation
Disabled public search as an option #1896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,6 +113,18 @@ public function viewTask() | |
| $tgs[] = $addtag; | ||
| } | ||
|
|
||
| if (!$this->config->get('allow_public_search', 1) && count($tgs) > 1 && User::isGuest()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| { | ||
| $return = base64_encode(Request::current(true)); | ||
|
|
||
| App::redirect( | ||
| Route::url('index.php?option=com_users&view=login&return=' . $return, false), | ||
| Lang::txt('COM_TAGS_SEARCH_LOGIN_REQUIRED'), | ||
| 'warning' | ||
| ); | ||
| return; | ||
| } | ||
|
|
||
| // Sanitize the tag | ||
| $tags = array(); | ||
| $added = array(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
410 Gone tells crawlers this URL is permanently dead, but it's valid for anyone logged in and whenever the option is re-enabled; and a guest gets an error page with no login link. The replacement sends guests to log in with a return URL, like the other guarded paths. (The
QUERY_STRINGregex above only differs fromRequest::getString('tag')for an empty?tag=, which then lands here too.)