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
fb69af5d
Commit
fb69af5d
authored
Dec 14, 2018
by
Carsten Rose
Browse files
Check not to try to number_format() empty string.
parent
27cd2105
Pipeline
#1142
passed with stage
in 1 minute and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/AbstractBuildForm.php
View file @
fb69af5d
...
...
@@ -1246,9 +1246,11 @@ abstract class AbstractBuildForm {
$value
=
''
;
}
if
(
$formElement
[
FE_DECIMAL_FORMAT
]
!==
''
)
{
$decimalScale
=
explode
(
','
,
$formElement
[
FE_DECIMAL_FORMAT
])[
1
];
// scale: Nachkommastellen
$value
=
number_format
(
$value
,
$decimalScale
,
'.'
,
''
);
if
(
$formElement
[
FE_DECIMAL_FORMAT
]
!==
''
)
{
if
(
$value
!==
''
)
{
// empty string causes exception in number_format()
$decimalScale
=
explode
(
','
,
$formElement
[
FE_DECIMAL_FORMAT
])[
1
];
// scale: Nachkommastellen
$value
=
number_format
(
$value
,
$decimalScale
,
'.'
,
''
);
}
}
// In case the user specifies MIN & MAX with numbers, the html tag 'type' has to be 'number', to make the range check work in the browser.
...
...
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