@@ -166,7 +166,7 @@ public function getSearchSQL($sql_where = '')
166166 $ this ->searchValues [$ search_prefix .$ field ] = $ out ;
167167 } else {
168168 if (isset ($ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ])){
169- $ this ->searchValues [$ search_prefix .$ field ] = $ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ];
169+ $ this ->searchValues [$ search_prefix .$ field ] = htmlspecialchars ( $ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ]) ;
170170 }
171171 }
172172 }
@@ -283,7 +283,7 @@ public function decode($record)
283283 switch ($ field ['datatype ' ]){
284284 case 'VARCHAR ' :
285285 case 'TEXT ' :
286- $ record [$ key ] = stripslashes ($ record [$ key ]);
286+ $ record [$ key ] = htmlentities ( stripslashes ($ record [$ key ]) );
287287 break ;
288288
289289 case 'DATE ' :
@@ -295,15 +295,15 @@ public function decode($record)
295295 break ;
296296
297297 case 'DOUBLE ' :
298- $ record [$ key ] = $ record [$ key ];
298+ $ record [$ key ] = htmlentities ( $ record [$ key ]) ;
299299 break ;
300300
301301 case 'CURRENCY ' :
302302 $ record [$ key ] = number_format ($ record [$ key ], 2 , ', ' , '' );
303303 break ;
304304
305305 default :
306- $ record [$ key ] = stripslashes ($ record [$ key ]);
306+ $ record [$ key ] = htmlentities ( stripslashes ($ record [$ key ]) );
307307 }
308308 }
309309 }
@@ -360,6 +360,19 @@ function lng($msg) {
360360 return $ app ->lng ($ msg );
361361 }
362362 }
363+
364+ function escapeArrayValues ($ search_values ) {
365+
366+ $ out = array ();
367+ if (is_array ($ search_values )) {
368+ foreach ($ search_values as $ key => $ val ) {
369+ $ out [$ key ] = htmlentities ($ val ,ENT_QUOTES );
370+ }
371+ }
372+
373+ return $ out ;
374+
375+ }
363376
364377}
365378
0 commit comments