File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments