Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
95820fbd
Commit
95820fbd
authored
9 years ago
by
Lukas Reschke
Committed by
Thomas Müller
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add magical regex to catch browsers
parent
c46f4800
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/dav/lib/files/browsererrorpageplugin.php
+7
-1
7 additions, 1 deletion
apps/dav/lib/files/browsererrorpageplugin.php
lib/private/appframework/http/request.php
+8
-0
8 additions, 0 deletions
lib/private/appframework/http/request.php
with
15 additions
and
1 deletion
apps/dav/lib/files/browsererrorpageplugin.php
+
7
−
1
View file @
95820fbd
...
@@ -57,7 +57,13 @@ class BrowserErrorPagePlugin extends ServerPlugin {
...
@@ -57,7 +57,13 @@ class BrowserErrorPagePlugin extends ServerPlugin {
if
(
$request
->
getMethod
()
!==
'GET'
)
{
if
(
$request
->
getMethod
()
!==
'GET'
)
{
return
false
;
return
false
;
}
}
return
$request
->
isUserAgent
([
Request
::
USER_AGENT_IE_8
]);
return
$request
->
isUserAgent
([
Request
::
USER_AGENT_IE
,
Request
::
USER_AGENT_MS_EDGE
,
Request
::
USER_AGENT_CHROME
,
Request
::
USER_AGENT_FIREFOX
,
Request
::
USER_AGENT_SAFARI
,
]);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
lib/private/appframework/http/request.php
+
8
−
0
View file @
95820fbd
...
@@ -56,6 +56,14 @@ class Request implements \ArrayAccess, \Countable, IRequest {
...
@@ -56,6 +56,14 @@ class Request implements \ArrayAccess, \Countable, IRequest {
const
USER_AGENT_IE
=
'/(MSIE)|(Trident)/'
;
const
USER_AGENT_IE
=
'/(MSIE)|(Trident)/'
;
const
USER_AGENT_IE_8
=
'/MSIE 8.0/'
;
const
USER_AGENT_IE_8
=
'/MSIE 8.0/'
;
// Microsoft Edge User Agent from https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
const
USER_AGENT_MS_EDGE
=
'/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+ Edge\/[0-9.]+$/'
;
// Firefox User Agent from https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference
const
USER_AGENT_FIREFOX
=
'/^Mozilla\/5\.0 \([^)]+\) Gecko\/[0-9.]+ Firefox\/[0-9.]+$/'
;
// Chrome User Agent from https://developer.chrome.com/multidevice/user-agent
const
USER_AGENT_CHROME
=
'/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+$/'
;
// Safari User Agent from http://www.useragentstring.com/pages/Safari/
const
USER_AGENT_SAFARI
=
'/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/[0-9.]+ Safari\/[0-9.A-Z]+$/'
;
// Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
// Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
const
USER_AGENT_ANDROID_MOBILE_CHROME
=
'#Android.*Chrome/[.0-9]*#'
;
const
USER_AGENT_ANDROID_MOBILE_CHROME
=
'#Android.*Chrome/[.0-9]*#'
;
const
USER_AGENT_FREEBOX
=
'#^Mozilla/5\.0$#'
;
const
USER_AGENT_FREEBOX
=
'#^Mozilla/5\.0$#'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment