Changeset 2904770
- Timestamp:
- 04/26/2023 10:32:54 PM (3 years ago)
- Location:
- g-core-labs-cdn/trunk
- Files:
-
- 8 edited
-
ajax/save.php (modified) (2 diffs)
-
includes/admin.php (modified) (2 diffs)
-
includes/front_cdn.php (modified) (1 diff)
-
includes/function.php (modified) (8 diffs)
-
includes/help.php (modified) (1 diff)
-
includes/stream.php (modified) (1 diff)
-
js/scripts.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
g-core-labs-cdn/trunk/ajax/save.php
r2771044 r2904770 16 16 if (isset($_POST['save'])) { 17 17 if ($get_tab == "main") { 18 $gcore_cdn_url = sanitize_ text_field(esc_url(trim($_POST['gcore_cdn_url'])));18 $gcore_cdn_url = sanitize_url(esc_url(trim($_POST['gcore_cdn_url']))); 19 19 if ($gcore_cdn_url != '') { 20 20 $gcore_cdn_url = trailingslashit(untrailingslashit($gcore_cdn_url)); … … 345 345 } 346 346 $data .= '</form>'; 347 echo $data;347 echo esc_html($data); -
g-core-labs-cdn/trunk/includes/admin.php
r2771044 r2904770 8 8 ]; 9 9 if (isset($_GET['tab']) and in_array($_GET['tab'], ['types', 'folders', 'exceptions'])) { 10 $get_tab = $_GET['tab'];10 $get_tab = sanitize_text_field($_GET['tab']); 11 11 } else { 12 12 $get_tab = 'main'; … … 333 333 } 334 334 335 $data .= ' 336 <script> 337 function msg(t) { 338 if(t == "save") { 339 jQuery.amaran({"message":"' . __("Saved", "gcore_translate") . '"}); 340 } 341 if(t == "del") { 342 jQuery.amaran({"message":"' . __("Deleted", "gcore_translate") . '"}); 343 } 344 if(t == "add") { 345 jQuery.amaran({"message":"' . __("Added", "gcore_translate") . '"}); 346 } 347 } 348 </script> 349 '; 350 351 echo $data; 335 $allowed_tags = wp_kses_allowed_html( 'post' ); 336 $allowed_tags['input'] = array( 337 'type' => true, 338 'name' => true, 339 'value' => true, 340 'disabled' => true, 341 'checked' => true, 342 'readonly' => true, 343 'data-e' => true, 344 'data-t' => true, 345 'data-o' => true, 346 'data-type' => true, 347 'placeholder' => true, 348 'id' => true, 349 'class' => true, 350 'required' => true, 351 ); 352 $allowed_tags['select'] = array( 353 'name' => true, 354 'value' => true, 355 'id' => true, 356 'class' => true, 357 'required' => true, 358 ); 359 $allowed_tags['button'] = array( 360 'value' => true, 361 'disabled' => true, 362 'type' => true, 363 'name' => true, 364 'data-e' => true, 365 'data-t' => true, 366 'data-o' => true, 367 'id' => true, 368 'class' => true, 369 'data-type' => true, 370 ); 371 $allowed_tags['option'] = array( 372 'value' => true, 373 ); 374 add_filter( 'safe_style_css', function( $styles ) { 375 $styles[] = 'display'; 376 return $styles; 377 } ); 378 echo wp_kses($data, $allowed_tags) 379 .'<script>const gcoreAmaranMsgSaved = "'.esc_html(__("Saved", "gcore_translate")).'";const gcoreAmaranMsgDeleted = "'.esc_html(__("Deleted", "gcore_translate")).'";const gcoreAmaranMsgAdded = "'.esc_html(__("Added", "gcore_translate")).'";</script>'; -
g-core-labs-cdn/trunk/includes/front_cdn.php
r2743991 r2904770 159 159 } 160 160 161 echo $string;161 echo esc_html($string); 162 162 } else 163 163 include($template); -
g-core-labs-cdn/trunk/includes/function.php
r2743991 r2904770 4 4 function gcore_ajax_save() 5 5 { 6 $type = $_POST['t'];6 $type = sanitize_text_field($_POST['t']); 7 7 if (in_array($_POST['t'], ['url', 'int', 'checkbox'])) { 8 8 $value = ''; 9 $option = $_POST['o'];9 $option = sanitize_text_field($_POST['o']); 10 10 if ($type == 'url') { 11 11 $value = sanitize_text_field(esc_url(trim($_POST['v']))); … … 14 14 } 15 15 } elseif ($type == 'int') { 16 $value = intval( $_POST['v']);16 $value = intval(sanitize_text_field($_POST['v'])); 17 17 } elseif ($type == 'checkbox') { 18 $value = intval( $_POST['v']);18 $value = intval(sanitize_text_field($_POST['v'])); 19 19 if ($option == 'gcore_type_advanced') { 20 20 update_option('gcore_type_image', 0); … … 32 32 } 33 33 update_option($option, $value); 34 echo $value;34 echo esc_html($value); 35 35 } else { 36 36 echo 0; … … 42 42 function gcore_ajax_advance_param_add() 43 43 { 44 $type = $_POST['t'];44 $type = sanitize_text_field($_POST['t']); 45 45 if (in_array($type, ['types', 'folders', 'exceptions'])) { 46 46 $gcore_array = get_option('gcore_cdn_' . $type); … … 86 86 function gcore_ajax_advance_param_del() 87 87 { 88 $type = $_POST['t'];88 $type = sanitize_text_field($_POST['t']); 89 89 if (in_array($type, ['types', 'folders', 'exceptions'])) { 90 90 $gcore_array = get_option('gcore_cdn_' . $type); … … 134 134 { 135 135 136 $type = $_POST['t'];136 $type = sanitize_text_field($_POST['t']); 137 137 $data = ""; 138 138 if (in_array($type, ['types', 'folders', 'exceptions'])) { … … 155 155 $data .= '<tr class="form-field form-required"> 156 156 <td scope="row">' . $element . '</td> 157 <td><button type="butt n" class="button-gcore g-delete" data-e="' . $element . '" data-type="' . $type . '">' . __("Delete", "gcore_translate") . '</button></td>157 <td><button type="button" class="button-gcore g-delete" data-e="' . $element . '" data-type="' . $type . '">' . __("Delete", "gcore_translate") . '</button></td> 158 158 </tr>'; 159 159 } … … 164 164 '; 165 165 } 166 echo $data; 167 wp_die(); 168 } 166 $allowed_tags = wp_kses_allowed_html( 'post' ); 167 $allowed_tags['input'] = array( 168 'type' => true, 169 'name' => true, 170 'value' => true, 171 'disabled' => true, 172 'checked' => true, 173 'readonly' => true, 174 'data-e' => true, 175 'data-t' => true, 176 'data-o' => true, 177 'data-type' => true, 178 'placeholder' => true, 179 'id' => true, 180 'class' => true, 181 'required' => true, 182 ); 183 $allowed_tags['select'] = array( 184 'name' => true, 185 'value' => true, 186 'id' => true, 187 'class' => true, 188 'required' => true, 189 ); 190 $allowed_tags['button'] = array( 191 'value' => true, 192 'disabled' => true, 193 'type' => true, 194 'name' => true, 195 'data-e' => true, 196 'data-t' => true, 197 'data-o' => true, 198 'id' => true, 199 'class' => true, 200 'data-type' => true, 201 ); 202 $allowed_tags['option'] = array( 203 'value' => true, 204 ); 205 add_filter( 'safe_style_css', function( $styles ) { 206 $styles[] = 'display'; 207 return $styles; 208 } ); 209 echo wp_kses($data, $allowed_tags); 210 wp_die(); 211 } -
g-core-labs-cdn/trunk/includes/help.php
r2771044 r2904770 3 3 $title = __('Help', 'gcore_translate'); 4 4 5 echo '<h1>' . $title. '</h1>6 <p>' . __('If you have questions regarding CDN integration, please email us at', 'gcore_translate') . ' <a href="mailto:[email protected]">[email protected]</a></p>';5 echo '<h1>' . esc_html($title) . '</h1> 6 <p>' . __('If you have questions regarding CDN integration, please email us at', 'gcore_translate') . ' ' . '<a href="mailto:"'. sanitize_email('[email protected]') . '">'. sanitize_email('[email protected]') . '</a></p>'; -
g-core-labs-cdn/trunk/includes/stream.php
r2288739 r2904770 1 <h1><?php echo _e("Streaming", "gcore_translate"); ?></h1>1 <h1><?php echo esc_html(_e("Streaming", "gcore_translate")); ?></h1> 2 2 <p>Soon</p> -
g-core-labs-cdn/trunk/js/scripts.js
r2400873 r2904770 78 78 }); 79 79 80 function msg(t) { 81 if(t == "save") { 82 jQuery.amaran({"message":gcoreAmaranMsgSaved}); 83 } 84 if(t == "del") { 85 jQuery.amaran({"message":gcoreAmaranMsgDeleted}); 86 } 87 if(t == "add") { 88 jQuery.amaran({"message":gcoreAmaranMsgAdded}); 89 } 90 } 91 80 92 jQuery('.advanced-show').on('click', 'button.g-delete', function () { 81 93 t = jQuery(this).data('type'); -
g-core-labs-cdn/trunk/readme.txt
r2866982 r2904770 41 41 42 42 = 1.1.10 = 43 * Change current wordpress version 43 * Change current wordpress version and change mistakes 44 44 45 45 = 1.1.9 =
Note: See TracChangeset
for help on using the changeset viewer.