Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
8203e8f7
Commit
8203e8f7
authored
Oct 05, 2018
by
Carsten Rose
Browse files
F5578 Safari only handles one filetype in upload dialog. refs #5578 and fixes #5578
parent
14ed99fc
Pipeline
#953
passed with stage
in 1 minute and 55 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
extension/qfq/qfq/AbstractBuildForm.php
View file @
8203e8f7
...
...
@@ -2958,6 +2958,17 @@ abstract class AbstractBuildForm {
$arr
[
FE_FILE_MAX_FILE_SIZE
]
=
empty
(
$formElement
[
FE_FILE_MAX_FILE_SIZE
])
?
UPLOAD_DEFAULT_MAX_SIZE
:
$formElement
[
FE_FILE_MAX_FILE_SIZE
];
$arr
[
FE_FILE_MAX_FILE_SIZE
]
=
Support
::
returnBytes
(
$arr
[
FE_FILE_MAX_FILE_SIZE
]);
// Check Safari Bug #5578: in case Safari (Mac OS X or iOS) loads an 'upload element' with more than one filetype, fall back to 'no preselection'.
if
(
strpos
(
$formElement
[
FE_FILE_MIME_TYPE_ACCEPT
],
','
)
!==
false
)
{
$ua
=
$this
->
store
->
getVar
(
'HTTP_USER_AGENT'
,
STORE_CLIENT
,
SANITIZE_ALLOW_ALNUMX
);
// Look for " Version/11.0 Mobile/15A5370a Safari/" or " Version/9.0.2 Safari/"
$rc
=
preg_match
(
' Version\/.*Safari\/'
,
$ua
,
$matches
);
// But not like " Version/4.0 Chrome/52.0.2743.98 Safari/"
if
(
$rc
==
1
&&
false
===
strpos
(
$matches
[
0
],
' Chrome/'
))
{
$formElement
[
FE_FILE_MIME_TYPE_ACCEPT
]
=
''
;
}
}
if
((
Support
::
returnBytes
(
ini_get
(
'post_max_size'
))
<
$arr
[
FE_FILE_MAX_FILE_SIZE
])
||
(
Support
::
returnBytes
(
ini_get
(
'upload_max_filesize'
))
<
$arr
[
FE_FILE_MAX_FILE_SIZE
])
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment