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
4ce6ad88
Commit
4ce6ad88
authored
Feb 20, 2020
by
Carsten Rose
Browse files
Fixes #10152: QCC() - Stored Procedure to escape : and ,
parent
d4614f8c
Pipeline
#3306
passed with stages
in 4 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Sql/function.sql
View file @
4ce6ad88
...
...
@@ -43,13 +43,29 @@ END;
#
DROP
FUNCTION
IF
EXISTS
QBAR
;
CREATE
FUNCTION
QBAR
(
input
TEXT
)
RETURNS
TEXT
DETERMINISTIC
SQL
SECURITY
INVOKER
RETURNS
TEXT
DETERMINISTIC
SQL
SECURITY
INVOKER
BEGIN
DECLARE
output
TEXT
;
SET
output
=
REPLACE
(
input
,
'|'
,
'
\\
|'
);
RETURN
output
;
DECLARE
output
TEXT
;
SET
output
=
REPLACE
(
input
,
'|'
,
'
\\
|'
);
RETURN
output
;
END
;
###
#
#
QCC
(
input
)
#
replaces
':'
(
colon
)
and
','
(
coma
)
in
`input`
with
'
\:
'
and
'
\,
'
#
DROP
FUNCTION
IF
EXISTS
QCC
;
CREATE
FUNCTION
QCC
(
input
TEXT
)
RETURNS
TEXT
DETERMINISTIC
SQL
SECURITY
INVOKER
BEGIN
DECLARE
output
TEXT
;
SET
output
=
REPLACE
(
REPLACE
(
input
,
':'
,
'
\\
:'
),
','
,
'
\\
,'
);
RETURN
output
;
END
;
###
...
...
@@ -59,9 +75,9 @@ END;
#
DROP
FUNCTION
IF
EXISTS
QNL2BR
;
CREATE
FUNCTION
QNL2BR
(
input
TEXT
)
RETURNS
TEXT
DETERMINISTIC
SQL
SECURITY
INVOKER
RETURNS
TEXT
DETERMINISTIC
SQL
SECURITY
INVOKER
BEGIN
DECLARE
output
TEXT
;
SET
output
=
REPLACE
(
REPLACE
(
input
,
CHAR
(
13
),
''
),
CHAR
(
10
),
'<br>'
);
...
...
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