Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADITO_Update_Upgrade
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab Maintenance 11.04.2025 | 20:00 - 23:00 MEZ
Show more breadcrumbs
xrm
ADITO_Update_Upgrade
Commits
df575195
Commit
df575195
authored
5 years ago
by
Johannes Goderbauer
Browse files
Options
Downloads
Patches
Plain Diff
Importer: fix errors if a value that contains a CR or LF is evaluated
parent
eca2d03b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/Importer_lib/process.js
+32
-7
32 additions, 7 deletions
process/Importer_lib/process.js
with
32 additions
and
7 deletions
process/Importer_lib/process.js
+
32
−
7
View file @
df575195
...
...
@@ -10,15 +10,30 @@ import("system.text");
import
(
"
ImporterCustomMappingFunctions_lib
"
);
import
(
"
ImporterMappingFunctions_lib
"
);
/////////////////////////////////////////////////////////////////////
/// importer module constructor function ///
/// DO NOT TOUCH - use lib_importerCustomMappingFunctions ///
///////////////////////////////////////////////////////////////////
/*
┌─────────────────────────────────────────────────────────────┐
│ importer module constructor function │
│ DO NOT TOUCH - use lib_importerCustomMappingFunctions │
└─────────────────────────────────────────────────────────────┘
Frequently asked questions:
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Q: Why does the importer have a own versionsystem, if there exists git?
A: Because its a standalone module and there is no modularisation-system right now.
So you may want to update the IMPORTER-module and have to keep an eye on the verison.
Q: Where can I see the version of the importer?
A: There is a @version-tag in the documentation of the Importer-function (constructor-function for the object)
*/
/*
* the importer class, main object
* @param {String []} pConfig req ( Name, FunktionsArt, Details )
*
* @version 2.0
* @version 2.1
*
*
* @return {void}
*/
...
...
@@ -1280,8 +1295,13 @@ function Importer(pConfig)
//transform ' to \\u0027 which is in eval a \u0027; transform " to \\u0022 which is in eval a \u0022
//needed for eval like: "'3'2' != ''"
//also escape LF and CR to prevent unterminated string errors
//if the transform of LF and CR cause problems:
//- remove the 2 replaces
//- document in the comment why it should not be used and when it will cause other problems
//- find another solution to prevent the unterminated string errors
if
(
pEvalScript
)
return
res
.
replace
(
"
'
"
,
"
\\\\
u0027
"
,
"
g
"
).
replace
(
"
\"
"
,
"
\\\\
u0022
"
,
"
g
"
);
return
res
.
replace
(
"
'
"
,
"
\\\\
u0027
"
,
"
g
"
).
replace
(
"
\"
"
,
"
\\\\
u0022
"
,
"
g
"
).
replace
(
"
\r
"
,
"
\\\\
u000D
"
,
"
g
"
).
replace
(
"
\n
"
,
"
\\\\
u000A
"
,
"
g
"
);
else
return
res
;
}
...
...
@@ -1289,8 +1309,13 @@ function Importer(pConfig)
{
//transform ' to \\u0027 which is in eval a \u0027; transform " to \\u0022 which is in eval a \u0022
//needed for eval like: "'3'2' != ''"
//also escape LF and CR to prevent unterminated string errors
//if the transform of LF and CR cause problems:
//- remove the 2 replaces
//- document in the comment why it should not be used and when it will cause other problems
//- find another solution to prevent the unterminated string errors
if
(
pEvalScript
)
return
inp
[
Number
(
pNumber
)].
replace
(
"
'
"
,
"
\\\\
u0027
"
,
"
g
"
).
replace
(
"
\"
"
,
"
\\\\
u0022
"
,
"
g
"
);
return
inp
[
Number
(
pNumber
)].
replace
(
"
'
"
,
"
\\\\
u0027
"
,
"
g
"
).
replace
(
"
\"
"
,
"
\\\\
u0022
"
,
"
g
"
).
replace
(
"
\r
"
,
"
\\\\
u000D
"
,
"
g
"
).
replace
(
"
\n
"
,
"
\\\\
u000A
"
,
"
g
"
);
else
return
inp
[
Number
(
pNumber
)];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment