|
30 | 30 | require('../../config.php'); |
31 | 31 | require($inc_path.'/resize_img.php'); |
32 | 32 | require($inc_path.'/pngthumb.php'); |
| 33 | +require($inc_path.'/functions.php'); |
33 | 34 | require_once(WB_PATH.'/framework/functions.php'); |
34 | 35 |
|
35 | 36 | // Get module name |
|
72 | 73 | $item_dir = $page['link']; |
73 | 74 |
|
74 | 75 | // Remove any tags and add slashes |
75 | | -$old_link = strip_tags($admin->get_post('link')); |
76 | | -$old_section_id = strip_tags($admin->get_post('section_id')); |
77 | | -$new_section_id = strip_tags($admin->get_post('new_section_id')); |
78 | | -$action = strip_tags($admin->get_post('action')); |
79 | | -$title = $admin->add_slashes(strip_tags($admin->get_post('title'))); |
80 | | -$scheduling_start = strip_tags($admin->get_post('scheduling_start')); |
81 | | -$scheduling_end = strip_tags($admin->get_post('scheduling_end')); |
82 | | -$description = $admin->add_slashes(strip_tags($admin->get_post('description'))); |
| 76 | +$old_link = lazystriptags($admin->get_post('link')); |
| 77 | +$old_section_id = lazystriptags($admin->get_post('section_id')); |
| 78 | +$new_section_id = lazystriptags($admin->get_post('new_section_id')); |
| 79 | +$action = lazystriptags($admin->get_post('action')); |
| 80 | +$title = $admin->add_slashes(lazystriptags($admin->get_post('title'))); |
| 81 | +$scheduling_start = lazystriptags($admin->get_post('scheduling_start')); |
| 82 | +$scheduling_end = lazystriptags($admin->get_post('scheduling_end')); |
| 83 | +$description = $admin->add_slashes(lazystriptags($admin->get_post('description'))); |
83 | 84 |
|
84 | 85 | // Images |
85 | 86 | $images = array(); |
86 | 87 | if (!empty($_POST['images'])) { |
87 | 88 | foreach ($_POST['images'] as $img_id => $image) { |
88 | 89 | // Strip tags and add slashes |
89 | | - $image = array_map('strip_tags', $image); |
| 90 | + $image = array_map('lazystriptags', $image); |
90 | 91 | $image = array_map('addslashes', $image); |
91 | 92 | // Sanitize vars |
92 | 93 | $image['active'] = empty($image['active']) ? 0 : 1; |
|
96 | 97 | } |
97 | 98 | } |
98 | 99 |
|
99 | | -$imgresize = strip_tags($admin->get_post('imgresize')); |
100 | | -$quality = strip_tags($admin->get_post('quality')); |
101 | | -$maxheight = strip_tags($admin->get_post('maxheight')); |
102 | | -$maxwidth = strip_tags($admin->get_post('maxwidth')); |
103 | | -$active = strip_tags($admin->get_post('active')); |
| 100 | +$imgresize = lazystriptags($admin->get_post('imgresize')); |
| 101 | +$quality = lazystriptags($admin->get_post('quality')); |
| 102 | +$maxheight = lazystriptags($admin->get_post('maxheight')); |
| 103 | +$maxwidth = lazystriptags($admin->get_post('maxwidth')); |
| 104 | +$active = lazystriptags($admin->get_post('active')); |
104 | 105 |
|
105 | 106 |
|
106 | 107 |
|
|
176 | 177 | if ($scheduling['ts_start'] && $scheduling['ts_end'] && $scheduling['ts_start'] >= $scheduling['ts_end']) { |
177 | 178 | $scheduling['end'] = $scheduling['start']; |
178 | 179 | $scheduling['ts_end'] = $scheduling['ts_start']; |
179 | | - $errors[] = sprintf($MOD_ONEFORALL[$mod_name]['ERR_INVALID_SCHEDULING'], htmlspecialchars($scheduling_start), htmlspecialchars($scheduling_end)); |
| 180 | + $errors[] = sprintf($MOD_ONEFORALL[$mod_name]['ERR_INVALID_SCHEDULING'], lazyspecial($scheduling_start), lazyspecial($scheduling_end)); |
180 | 181 | } |
181 | 182 | // Serialize start and end time |
182 | 183 | $scheduling = serialize($scheduling); |
|
188 | 189 | $field_id = $field['field_id']; |
189 | 190 | $email = $_POST['fields'][$field_id]; |
190 | 191 | if (!empty($email) && !filter_var($email, FILTER_VALIDATE_EMAIL)) { |
191 | | - $errors[] = sprintf($MOD_ONEFORALL[$mod_name]['ERR_INVALID_EMAIL'], htmlspecialchars($email)); |
| 192 | + $errors[] = sprintf($MOD_ONEFORALL[$mod_name]['ERR_INVALID_EMAIL'], lazyspecial($email)); |
192 | 193 | } |
193 | 194 | } |
194 | 195 | } |
|
200 | 201 | $field_id = $field['field_id']; |
201 | 202 | $url = $_POST['fields'][$field_id]; |
202 | 203 | if (!empty($url) && !filter_var($url, FILTER_VALIDATE_URL)) { |
203 | | - $errors[] = sprintf($MOD_ONEFORALL[$mod_name]['ERR_INVALID_URL'], htmlspecialchars($url)); |
| 204 | + $errors[] = sprintf($MOD_ONEFORALL[$mod_name]['ERR_INVALID_URL'], lazyspecial($url)); |
204 | 205 | } |
205 | 206 | } |
206 | 207 | } |
|
280 | 281 | } |
281 | 282 | // Check for invalid chars in filename |
282 | 283 | if (!preg_match('#^[a-zA-Z0-9._-]*$#', $filename)) { |
283 | | - $errors[] = $MOD_ONEFORALL[$mod_name]['ERR_INVALID_FILE_NAME'].": ".htmlspecialchars($filename.'.'.$fileext); |
| 284 | + $errors[] = $MOD_ONEFORALL[$mod_name]['ERR_INVALID_FILE_NAME'].": ".lazyspecial($filename.'.'.$fileext); |
284 | 285 | continue; |
285 | 286 | } |
286 | 287 | // Check if filename already exists |
287 | 288 | if (file_exists($file_path)) { |
288 | | - $errors[] = $MESSAGE['MEDIA']['FILE_EXISTS'].": ".htmlspecialchars($filename.'.'.$fileext); |
| 289 | + $errors[] = $MESSAGE['MEDIA']['FILE_EXISTS'].": ".lazyspecial($filename.'.'.$fileext); |
289 | 290 | continue; |
290 | 291 | } |
291 | 292 |
|
|
0 commit comments