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
a1c91eee
Commit
a1c91eee
authored
Mar 27, 2019
by
Marc Egger
Browse files
Fixes #8109 change email pattern and disable sanitize for FORM_UPDATE
parent
e00853d2
Pipeline
#1783
failed with stage
in 2 minutes and 15 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Source/core/AbstractBuildForm.php
View file @
a1c91eee
...
...
@@ -697,7 +697,8 @@ abstract class AbstractBuildForm {
$storeUse
=
str_replace
(
STORE_TABLE_DEFAULT
,
''
,
$storeUse
);
// Remove STORE_DEFAULT
}
// Retrieve value via FSRVD
$value
=
$this
->
store
->
getVar
(
$name
,
$storeUse
,
$formElement
[
FE_CHECK_TYPE
],
$foundInStore
);
$sanitizeClass
=
$mode
==
FORM_UPDATE
?
SANITIZE_ALLOW_ALL
:
$formElement
[
FE_CHECK_TYPE
];
$value
=
$this
->
store
->
getVar
(
$name
,
$storeUse
,
$sanitizeClass
,
$foundInStore
);
}
if
(
$formElement
[
FE_ENCODE
]
===
FE_ENCODE_SPECIALCHAR
)
{
...
...
extension/Source/core/Constants.php
View file @
a1c91eee
...
...
@@ -105,7 +105,7 @@ const SANITIZE_TYPE_MESSAGE_VIOLATE_CLASS = 'c';
const
PATTERN_ALNUMX
=
'^[@\-_\.,;: \/\(\)a-zA-Z0-9ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüÿç]*$'
;
const
PATTERN_DIGIT
=
'^[\d]*$'
;
const
PATTERN_NUMERICAL
=
'^[\d.+-]*$'
;
const
PATTERN_EMAIL
=
'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
;
const
PATTERN_EMAIL
=
'^
(
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
)?
$'
;
const
PATTERN_ALLBUT
=
'^[^\[\]{}%\\\\#]*$'
;
const
PATTERN_ALL
=
'.*'
;
...
...
extension/Tests/unit/core/helper/SanitizeTest.php
View file @
a1c91eee
...
...
@@ -28,7 +28,7 @@ class SanitizeTest extends TestCase {
# Check ''
$this
->
assertEquals
(
''
,
Sanitize
::
sanitize
(
''
,
SANITIZE_ALLOW_ALNUMX
),
"SANITIZE_ALNUMX fails"
);
$this
->
assertEquals
(
''
,
Sanitize
::
sanitize
(
''
,
SANITIZE_ALLOW_DIGIT
),
"SANITIZE_DIGIT fails"
);
$this
->
assertEquals
(
'
!!email!!
'
,
Sanitize
::
sanitize
(
''
,
SANITIZE_ALLOW_EMAIL
),
"SANITIZE_EMAIL fails"
);
$this
->
assertEquals
(
''
,
Sanitize
::
sanitize
(
''
,
SANITIZE_ALLOW_EMAIL
),
"SANITIZE_EMAIL fails"
);
$this
->
assertEquals
(
''
,
Sanitize
::
sanitize
(
''
,
SANITIZE_ALLOW_PATTERN
,
'.*'
),
"SANITIZE_PATTERN fails"
);
$this
->
assertEquals
(
''
,
Sanitize
::
sanitize
(
''
,
SANITIZE_ALLOW_ALL
),
"SANITIZE_ALL fails"
);
$this
->
assertEquals
(
''
,
Sanitize
::
sanitize
(
''
,
SANITIZE_ALLOW_ALLBUT
),
"SANITIZE_ALLBUT fails"
);
...
...
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