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
d532b4f2
Commit
d532b4f2
authored
Jul 10, 2018
by
Carsten Rose
Browse files
Link.php: wrong detection of missing parameter for download button.
parent
f2f58358
Pipeline
#683
passed with stage
in 1 minute and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/report/Link.php
View file @
d532b4f2
...
@@ -237,6 +237,7 @@ class Link {
...
@@ -237,6 +237,7 @@ class Link {
TOKEN_MAIL
=>
LINK_ANCHOR
,
TOKEN_MAIL
=>
LINK_ANCHOR
,
TOKEN_PAGE
=>
LINK_ANCHOR
,
TOKEN_PAGE
=>
LINK_ANCHOR
,
TOKEN_DOWNLOAD
=>
LINK_ANCHOR
,
TOKEN_DOWNLOAD
=>
LINK_ANCHOR
,
TOKEN_FILE
=>
NAME_FILE
,
TOKEN_COPY_TO_CLIPBOARD
=>
LINK_ANCHOR
,
TOKEN_COPY_TO_CLIPBOARD
=>
LINK_ANCHOR
,
TOKEN_PICTURE
=>
LINK_PICTURE
,
TOKEN_PICTURE
=>
LINK_PICTURE
,
...
@@ -701,6 +702,7 @@ class Link {
...
@@ -701,6 +702,7 @@ class Link {
private
function
checkParam
(
array
$tokenGiven
,
array
$vars
)
{
private
function
checkParam
(
array
$tokenGiven
,
array
$vars
)
{
$countLinkAnchor
=
0
;
$countLinkAnchor
=
0
;
$countLinkPicture
=
0
;
$countLinkPicture
=
0
;
$countSources
=
0
;
foreach
(
$tokenGiven
as
$token
=>
$value
)
{
foreach
(
$tokenGiven
as
$token
=>
$value
)
{
if
(
isset
(
$this
->
tokenMapping
[
$token
]))
{
if
(
isset
(
$this
->
tokenMapping
[
$token
]))
{
...
@@ -711,6 +713,11 @@ class Link {
...
@@ -711,6 +713,11 @@ class Link {
case
LINK_PICTURE
:
case
LINK_PICTURE
:
$countLinkPicture
++
;
$countLinkPicture
++
;
break
;
break
;
case
NAME_FILE
:
case
NAME_URL
:
case
NAME_PAGE
:
$countSources
++
;
break
;
default
:
default
:
break
;
break
;
}
}
...
@@ -729,7 +736,7 @@ class Link {
...
@@ -729,7 +736,7 @@ class Link {
throw
new
UserReportException
(
"Token Mail and Target at the same time not possible'"
.
TOKEN_PAGE
.
"'"
,
ERROR_MULTIPLE_DEFINITION
);
throw
new
UserReportException
(
"Token Mail and Target at the same time not possible'"
.
TOKEN_PAGE
.
"'"
,
ERROR_MULTIPLE_DEFINITION
);
}
}
if
(
isset
(
$tokenGiven
[
TOKEN_DOWNLOAD
])
&&
count
(
$vars
[
NAME_COLLECT_ELEMENTS
])
==
0
)
{
if
(
isset
(
$tokenGiven
[
TOKEN_DOWNLOAD
])
&&
count
(
$vars
[
NAME_COLLECT_ELEMENTS
])
==
0
&&
$countSources
==
0
)
{
throw
new
UserReportException
(
"Missing element sources for download"
,
ERROR_MISSING_REQUIRED_PARAMETER
);
throw
new
UserReportException
(
"Missing element sources for download"
,
ERROR_MISSING_REQUIRED_PARAMETER
);
}
}
}
}
...
...
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