mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
CHANGE: We now include the _escaped_fragment_
support by default, but
only if the crawler check fails. It is a fallback for non-google search engines that support the Ajax crawling API.
This commit is contained in:
@ -39,8 +39,12 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
layout :set_layout
|
||||
|
||||
def has_escaped_fragment?
|
||||
SiteSetting.enable_escaped_fragments? && params.key?("_escaped_fragment_")
|
||||
end
|
||||
|
||||
def set_layout
|
||||
CrawlerDetection.crawler?(request.user_agent) ? 'crawler' : 'application'
|
||||
has_escaped_fragment? || CrawlerDetection.crawler?(request.user_agent) ? 'crawler' : 'application'
|
||||
end
|
||||
|
||||
rescue_from Exception do |exception|
|
||||
|
Reference in New Issue
Block a user