@@ -126,7 +126,7 @@ private function getDatasourceData($field)
126126
127127 public function getSearchSQL ($ sql_where = '' )
128128 {
129- global $ db ;
129+ global $ app , $ db ;
130130
131131 //* Get config variable
132132 $ list_name = $ this ->listDef ['name ' ];
@@ -151,9 +151,10 @@ public function getSearchSQL($sql_where = '')
151151 }
152152
153153 //* Store field in session
154- if (isset ($ _REQUEST [$ search_prefix .$ field ])){
154+ if (isset ($ _REQUEST [$ search_prefix .$ field ]) && ! stristr ( $ _REQUEST [ $ search_prefix . $ field ], " ' " ) ){
155155 $ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ] = $ _REQUEST [$ search_prefix .$ field ];
156- }
156+ if (preg_match ("/[' \\\\]/ " , $ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ])) $ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ] = '' ;
157+ }
157158
158159 if (isset ($ i ['formtype ' ]) && $ i ['formtype ' ] == 'SELECT ' ){
159160 if (is_array ($ i ['value ' ])) {
@@ -181,7 +182,7 @@ public function getSearchSQL($sql_where = '')
181182 $ field = $ i ['field ' ];
182183 // if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and";
183184 if (isset ($ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ]) && $ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ] != '' ){
184- $ sql_where .= " $ field " .$ i ['op ' ]." ' " .$ i ['prefix ' ].$ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ].$ i ['suffix ' ]."' and " ;
185+ $ sql_where .= " $ field " .$ i ['op ' ]." ' " .$ app -> db -> quote ( $ i ['prefix ' ].$ _SESSION ['search ' ][$ list_name ][$ search_prefix .$ field ].$ i ['suffix ' ]) ."' and " ;
185186 }
186187 }
187188 }
@@ -209,12 +210,12 @@ public function getPagingSQL($sql_where = '1')
209210 }
210211
211212 //* set PAGE to worth request variable "PAGE" - ? setze page auf wert der request variablen "page"
212- if (isset ($ _REQUEST ["page " ])) $ _SESSION ["search " ][$ list_name ]["page " ] = $ _REQUEST ["page " ];
213+ if (isset ($ _REQUEST ["page " ])) $ _SESSION ["search " ][$ list_name ]["page " ] = intval ( $ _REQUEST ["page " ]) ;
213214
214215 //* PAGE to 0 set, if look for themselves ? page auf 0 setzen, wenn suche sich ge�ndert hat.
215216 if ($ this ->searchChanged == 1 ) $ _SESSION ['search ' ][$ list_name ]['page ' ] = 0 ;
216217
217- $ sql_von = $ _SESSION ['search ' ][$ list_name ]['page ' ] * $ records_per_page ;
218+ $ sql_von = intval ( $ _SESSION ['search ' ][$ list_name ]['page ' ] * $ records_per_page) ;
218219 $ record_count = $ app ->db ->queryOneRecord ("SELECT count(*) AS anzahl FROM $ table WHERE $ sql_where " );
219220 $ pages = intval (($ record_count ['anzahl ' ] - 1 ) / $ records_per_page );
220221
@@ -428,4 +429,4 @@ function escapeArrayValues($search_values) {
428429
429430}
430431
431- ?>
432+ ?>
0 commit comments