Skip to content
GitLab
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
07317b2a
Commit
07317b2a
authored
Jan 29, 2018
by
Elias Villiger
Browse files
Implement max test #5309
parent
803fecf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/Constants.php
View file @
07317b2a
...
...
@@ -187,7 +187,7 @@ const ERROR_PLAY_SQL_FILE = 1080;
const
ERROR_MISSING_FILE_NAME
=
1081
;
const
ERROR_MAX_FILE_SIZE_TOO_BIG
=
1082
;
const
ERROR_SMALLER_THAN_MIN
=
1083
;
const
ERROR_
GREAT
ER_THAN_MAX
=
1084
;
const
ERROR_
LARG
ER_THAN_MAX
=
1084
;
// Subrecord
const
ERROR_SUBRECORD_MISSING_COLUMN_ID
=
1100
;
...
...
extension/qfq/qfq/helper/Sanitize.php
View file @
07317b2a
...
...
@@ -44,12 +44,12 @@ class Sanitize {
$sanitizeClass
=
Support
::
setIfNotSet
(
$formElement
,
FE_CHECK_TYPE
,
SANITIZE_DEFAULT
);
$pattern
=
Support
::
setIfNotSet
(
$formElement
,
FE_CHECK_PATTERN
);
$min
=
Support
::
setIfNotSet
(
$formElement
,
FE_MIN
,
null
);
//
$max
// $minMaxCompareMode
$max
=
Support
::
setIfNotSet
(
$formElement
,
FE_MAX
,
null
);
//
TODO:
$minMaxCompareMode
$errorCode
=
0
;
$errorText
=
''
;
// Prepare
checktype C
heck
// Prepare
pattern c
heck
switch
(
$sanitizeClass
)
{
case
SANITIZE_ALLOW_PATTERN
:
break
;
...
...
@@ -63,7 +63,7 @@ class Sanitize {
$pattern
=
$arr
[
$sanitizeClass
];
break
;
case
SANITIZE_ALLOW_ALL
:
// no check
t
ype specified.
case
SANITIZE_ALLOW_ALL
:
// no check
T
ype specified.
$pattern
=
''
;
break
;
...
...
@@ -78,12 +78,16 @@ class Sanitize {
}
// Min/max check (only necessary if pattern check passed)
// minMaxCompareMode: Default richtet sich nach Type des FE (bei type date: string, ansonsten: numerical)
//
TODO:
minMaxCompareMode: Default richtet sich nach Type des FE (bei type date: string, ansonsten: numerical)
if
(
$errorCode
==
0
)
{
if
(
$min
!==
null
&&
$value
<
$min
)
{
$errorCode
=
ERROR_SMALLER_THAN_MIN
;
$errorText
=
"Value '
$value
' is smaller than the allowed minimum of '
$min
'."
;
}
if
(
$max
!==
null
&&
$value
>
$max
)
{
$errorCode
=
ERROR_LARGER_THAN_MAX
;
$errorText
=
"Value '
$value
' is larger than the allowed maximum of '
$max
'."
;
}
}
if
(
$errorCode
==
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment