Skip to content

Commit fb93d42

Browse files
committed
lint
1 parent 002c68d commit fb93d42

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

modules/redcap/tools/redcap2linst.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ function updateREDCapDictionaryInstrumentEntries(
162162
'untouched' => 0
163163
];
164164

165+
// closure for escaped html
166+
$cleanHTML = fn($v) => is_string($v)
167+
? htmlspecialchars(
168+
$v,
169+
ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5,
170+
'UTF-8',
171+
false
172+
)
173+
: $v;
174+
165175
// go through entries for this instrument
166176
foreach ($redcap_dictionary as $redcap_dictionary_entry) {
167177
// get the db correspoding field name
@@ -179,14 +189,6 @@ function updateREDCapDictionaryInstrumentEntries(
179189

180190
// escape HTML from this entry to compare
181191
// same method use in Database class -> update
182-
$cleanHTML = fn($v) => is_string($v)
183-
? htmlspecialchars(
184-
$v,
185-
ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5,
186-
'UTF-8',
187-
false
188-
)
189-
: $v;
190192
$escaped_props = array_map(
191193
$cleanHTML,
192194
$redcap_dictionary_entry->toArray()

0 commit comments

Comments
 (0)