mirror of
https://github.com/friendica/friendica
synced 2025-04-28 15:04:26 +02:00
Issue 9303: Detect AP accesses as backend, prevent ping pong
This commit is contained in:
parent
97f07b7518
commit
73a7df85f7
3 changed files with 25 additions and 5 deletions
|
@ -134,8 +134,15 @@ class Mode
|
|||
*/
|
||||
public function determineRunMode(bool $isBackend, Module $module, array $server, MobileDetect $mobileDetect)
|
||||
{
|
||||
$isBackend = $isBackend ||
|
||||
$module->isBackend();
|
||||
$contenttypes = ['application/jrd+json', 'application/xrd+xml', 'text/xml',
|
||||
'application/rss+xml', 'application/atom+xml', 'application/activity+json'];
|
||||
foreach ($contenttypes as $type) {
|
||||
if (strpos(strtolower($server['HTTP_ACCEPT'] ?? ''), $type) !== false) {
|
||||
$isBackend = true;
|
||||
}
|
||||
}
|
||||
|
||||
$isBackend = $isBackend || $module->isBackend();
|
||||
$isMobile = $mobileDetect->isMobile();
|
||||
$isTablet = $mobileDetect->isTablet();
|
||||
$isAjax = strtolower($server['HTTP_X_REQUESTED_WITH'] ?? '') == 'xmlhttprequest';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue