Changes in linkworth-wp-plugin [2750802:2754739]
- Location:
- linkworth-wp-plugin
- Files:
-
- 7 added
- 3 edited
-
tags/3.3.3 (added)
-
tags/3.3.3/LinkWorth_WordPress.php (added)
-
tags/3.3.3/lw_includes (added)
-
tags/3.3.3/lw_includes/LinkWorth_MU.php (added)
-
tags/3.3.3/lw_includes/LinkWorth_admin.php (added)
-
tags/3.3.3/lw_includes/LinkWorth_parser.php (added)
-
tags/3.3.3/readme.txt (added)
-
trunk/LinkWorth_WordPress.php (modified) (7 diffs)
-
trunk/lw_includes/LinkWorth_admin.php (modified) (19 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
linkworth-wp-plugin/trunk/LinkWorth_WordPress.php
r2750802 r2754739 5 5 Description: LinkWorth Easy Link Syndication for WordPress and WPMU 6 6 Author: LinkWorth 7 Version: 3.3. 37 Version: 3.3.4 8 8 Author URI: http://www.linkworth.com/ 9 9 License: GPLv2 or later … … 308 308 } 309 309 310 function get_contents( $url ) 311 { 312 global $lw_debug_information; 313 314 $lw_debug_information .= 'get_contents() running - '.$url.'++'; 315 316 if( !empty( $url ) ) 317 { 318 $curl_handle = curl_init(); 319 curl_setopt( $curl_handle, CURLOPT_URL, $url ); 320 curl_setopt( $curl_handle, CURLOPT_CONNECTTIMEOUT, 30 ); 321 curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true ); 322 323 if( @ini_get('open_basedir') == '' && @ini_get('safe_mode') == 'Off' ) 324 { 325 curl_setopt( $curl_handle, CURLOPT_FOLLOWLOCATION, true ); 326 curl_setopt( $curl_handle, CURLOPT_MAXREDIRS, 2 ); 327 } 328 329 if( curl_exec( $curl_handle ) === false ) 330 { 331 $curl_error = 'Curl error: ' . curl_error( $curl_handle ); 332 } 333 334 $string = curl_exec( $curl_handle ); 335 curl_close( $curl_handle ); 336 } 337 338 if( isset( $_GET['debug'] ) ) 339 { 340 if( !empty( $curl_error ) ) 341 { 342 $lw_debug_information .= $curl_error.'++'; 343 } 344 345 if( empty( $string ) ) 346 { 347 $lw_debug_information .= 'get_contents() empty++'; 348 } 349 } 350 351 return $string; 352 } 310 function get_contents($url) 311 { 312 global $lw_debug_information; 313 314 $string = ''; 315 $wp_remote_get_error = ''; 316 317 $lw_debug_information .= 'get_contents() running - '.$url.'++'; 318 319 if (!empty($url)) { 320 321 $response = wp_remote_get($url); 322 $http_code = wp_remote_retrieve_response_code($response); 323 324 if ($http_code == '200') { 325 326 $string = wp_remote_retrieve_body($response); 327 328 } else { 329 330 $wp_remote_get_error = 'get_contents() error: ' . wp_remote_retrieve_header($response, 'status'); 331 } 332 } 333 334 if (isset($_GET['debug'])) { 335 336 if (!empty($wp_remote_get_error)) { 337 338 $lw_debug_information .= $wp_remote_get_error.'++'; 339 } 340 341 if (empty($string)) { 342 343 $lw_debug_information .= 'get_contents() empty++'; 344 } 345 } 346 347 return $string; 348 } 353 349 354 350 // --------------------------------------------------------------------------------------- … … 651 647 } 652 648 653 if( function_exists( ' curl_init' ) )649 if( function_exists( 'wp_remote_get' ) ) 654 650 { 655 651 $support_array['can_get_ads'] = 1; … … 836 832 if( is_numeric( $ad['location'] ) ) 837 833 { 838 $page_uri = $_SERVER['REQUEST_URI'];834 $page_uri = htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8'); 839 835 840 836 if( is_home() || is_front_page() ) … … 1163 1159 { 1164 1160 //SET DEFAULT VARIABLES 1165 $current_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];1161 $current_url = $_SERVER['SERVER_NAME'] . htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8'); 1166 1162 $links = array(); 1167 1163 $tags = array(); … … 1432 1428 if( isset( $_POST['linkw-submit'] ) ) 1433 1429 { 1434 $options['title'] = strip_tags( stripslashes( $_POST['linkw-title']) );1430 $options['title'] = strip_tags( stripslashes( htmlspecialchars($_POST['linkw-title'], ENT_QUOTES, 'UTF-8') ) ); 1435 1431 update_option( 'lw_widget', $options ); 1436 1432 } … … 1438 1434 if( !empty( $options['title'] ) ) 1439 1435 { 1440 $title = htmlspecialchars( $options['title'], ENT_QUOTES );1436 $title = $options['title']; 1441 1437 } 1442 1438 else -
linkworth-wp-plugin/trunk/lw_includes/LinkWorth_admin.php
r2750802 r2754739 21 21 22 22 //UPDATE DEALS 23 if( isset( $_POST['lw_update_deal_list'] ) )23 if( isset( $_POST['lw_update_deal_list'] ) && wp_verify_nonce($_POST['update_general_settings_field'], 'update_general_settings_action') ) 24 24 { 25 25 update_option( 'lw_cache_time', 0 ); … … 32 32 33 33 //DELETE SETTINGS 34 if( isset( $_POST['lw_delete_settings'] ) )34 if( isset( $_POST['lw_delete_settings'] ) && wp_verify_nonce($_POST['update_advanced_options_field'], 'update_advanced_options_action') ) 35 35 { 36 36 delete_option('lw_linkintxts'); … … 46 46 $billboard_base = 'pages'; 47 47 } 48 elseif( isset( $_POST['lw_update_settings'] ) )48 elseif( isset( $_POST['lw_update_settings'] ) && wp_verify_nonce($_POST['update_advanced_options_field'], 'update_advanced_options_action') ) 49 49 { 50 50 //PROCESS POST BEFOR UPDATING … … 72 72 } 73 73 74 $updated_lw_options['loop_number'] = $_POST['lw_ops']['loop_number'];75 $updated_lw_options['nocontentads'] = $_POST['lw_ops']['nocontentads'];76 $updated_lw_options['debug'] = $_POST['lw_ops']['debug'];77 $updated_lw_options['disable_silent'] = $_POST['lw_ops']['disable_silent'];78 $updated_lw_options['lw_linkscale'] = $_POST['lw_ops']['lw_linkscale'];74 $updated_lw_options['loop_number'] = sanitize_text_field($_POST['lw_ops']['loop_number']); 75 $updated_lw_options['nocontentads'] = sanitize_text_field($_POST['lw_ops']['nocontentads']); 76 $updated_lw_options['debug'] = sanitize_text_field($_POST['lw_ops']['debug']); 77 $updated_lw_options['disable_silent'] = sanitize_text_field($_POST['lw_ops']['disable_silent']); 78 $updated_lw_options['lw_linkscale'] = sanitize_text_field($_POST['lw_ops']['lw_linkscale']); 79 79 } 80 80 else 81 81 { 82 $updated_lw_options['lw_sidebar'] = $_POST['lw_ops']['lw_sidebar'];83 $updated_lw_options['lw_sidebarwidget'] = $_POST['lw_ops']['lw_sidebarwidget'];82 $updated_lw_options['lw_sidebar'] = sanitize_text_field($_POST['lw_ops']['lw_sidebar']); 83 $updated_lw_options['lw_sidebarwidget'] = sanitize_text_field($_POST['lw_ops']['lw_sidebarwidget']); 84 84 $updated_lw_options['lw_cssmod'] = 0; 85 $updated_lw_options['lw_linktype'] = $_POST['lw_ops']['lw_linktype'];86 $updated_lw_options['lw_linkcolor'] = $_POST['lw_ops']['lw_linkcolor'];87 $updated_lw_options['website_id'] = $_POST['lw_ops']['website_id'];88 $updated_lw_options['website_hash'] = $_POST['lw_ops']['website_hash'];89 $updated_lw_options['billboard_base'] = $_POST['lw_ops']['billboard_base'];90 $updated_lw_options['lw_linksize'] = $_POST['lw_ops']['lw_linksize'];85 $updated_lw_options['lw_linktype'] = sanitize_text_field($_POST['lw_ops']['lw_linktype']); 86 $updated_lw_options['lw_linkcolor'] = sanitize_text_field($_POST['lw_ops']['lw_linkcolor']); 87 $updated_lw_options['website_id'] = sanitize_text_field($_POST['lw_ops']['website_id']); 88 $updated_lw_options['website_hash'] = sanitize_text_field($_POST['lw_ops']['website_hash']); 89 $updated_lw_options['billboard_base'] = sanitize_text_field($_POST['lw_ops']['billboard_base']); 90 $updated_lw_options['lw_linksize'] = sanitize_text_field($_POST['lw_ops']['lw_linksize']); 91 91 92 92 if( isset( $_POST['lw_ops']['site_id'] ) && isset( $_POST['lw_ops']['site_hash'] ) ) 93 93 { 94 $updated_lw_options['site_id'] = $_POST['lw_ops']['site_id'];95 $updated_lw_options['site_hash'] = $_POST['lw_ops']['site_hash'];94 $updated_lw_options['site_id'] = sanitize_text_field($_POST['lw_ops']['site_id']); 95 $updated_lw_options['site_hash'] = sanitize_text_field($_POST['lw_ops']['site_hash']); 96 96 } 97 97 } … … 284 284 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's SITE ID?</td> 285 285 <td colspan="2"> 286 <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value="<?php if(defined('LW_WEBSITE_ID')) { echo LW_WEBSITE_ID; } ?>"<?php echo $disabled_option?> />286 <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value="<?php if(defined('LW_WEBSITE_ID')) { echo LW_WEBSITE_ID; } ?>"<?php echo esc_attr($disabled_option) ?> /> 287 287 </td> 288 288 </tr> … … 290 290 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's HASH ID?</td> 291 291 <td colspan="2"> 292 <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value="<?php if(defined('LW_HASH')) { echo LW_HASH; } ?>"<?php echo $disabled_option?> />292 <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value="<?php if(defined('LW_HASH')) { echo LW_HASH; } ?>"<?php echo esc_attr($disabled_option) ?> /> 293 293 </td> 294 294 </tr> … … 362 362 <select name="lw_ops[lw_linkcolor]" style="width:100px;"> 363 363 <option value="">Select One</option> 364 <option value="1"<?php echo $lw_color_array_selected[1]?>>AquaMarine</option>365 <option value="2"<?php echo $lw_color_array_selected[2]?>>Forest</option>366 <option value="3"<?php echo $lw_color_array_selected[3]?>>Winter</option>367 <option value="4"<?php echo $lw_color_array_selected[4]?>>Summer</option>368 <option value="5"<?php echo $lw_color_array_selected[5]?>>Fruity</option>369 <option value="6"<?php echo $lw_color_array_selected[6]?>>Baby</option>370 <option value="7"<?php echo $lw_color_array_selected[7]?>>Highway</option>364 <option value="1"<?php echo esc_attr($lw_color_array_selected[1]) ?>>AquaMarine</option> 365 <option value="2"<?php echo esc_attr($lw_color_array_selected[2]) ?>>Forest</option> 366 <option value="3"<?php echo esc_attr($lw_color_array_selected[3]) ?>>Winter</option> 367 <option value="4"<?php echo esc_attr($lw_color_array_selected[4]) ?>>Summer</option> 368 <option value="5"<?php echo esc_attr($lw_color_array_selected[5]) ?>>Fruity</option> 369 <option value="6"<?php echo esc_attr($lw_color_array_selected[6]) ?>>Baby</option> 370 <option value="7"<?php echo esc_attr($lw_color_array_selected[7]) ?>>Highway</option> 371 371 </select> 372 372 </td> … … 383 383 <tr> 384 384 <td colspan='2'> 385 <a href="#" style="color:<?php echo $test_color[0];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Link 1</a> 386 <a href="#" style="color:<?php echo $test_color[1];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Another Link</a> 387 <a href="#" style="color:<?php echo $test_color[2];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Anchor 4</a> 385 <a href="#" style="color:<?php echo esc_attr($test_color[0]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Link 1</a> 386 <a href="#" style="color:<?php echo esc_attr($test_color[1]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Another Link</a> 387 <a href="#" style="color:<?php echo esc_attr($test_color[2]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Anchor 4</a> 388 388 <br /> 389 <a href="#" style="color:<?php echo $test_color[3];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">A Link</a> 390 <a href="#" style="color:<?php echo $test_color[4];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Click me</a> 391 <a href="#" style="color:<?php echo $test_color[5];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Another Anchor</a> 389 <a href="#" style="color:<?php echo esc_attr($test_color[3]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">A Link</a> 390 <a href="#" style="color:<?php echo esc_attr($test_color[4]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Click me</a> 391 <a href="#" style="color:<?php echo esc_attr($test_color[5]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Another Anchor</a> 392 392 </td> 393 393 </tr> … … 426 426 <p style="display:inline-block; margin-top:0;"><small><em>(Overview of published adverts.)</em></small></p> 427 427 <p>Information listed here has been generated based on the lists of approved ads in your LinkWorth account on our servers.</p> 428 428 429 429 <table cellspacing="0" cellpadding="0" class="widefat"> 430 430 <thead> … … 474 474 ?> 475 475 <tr> 476 <td><a href="<?php echo $protocol.$ad['url']?>"><?php echo $ad['anchor']?></a></td>477 <td><?php echo $lw_humanloc?></td>478 <td><?php echo ((!is_array($ad['description']) || !empty($ad['description'])) ? $ad['description']: '');?></td>476 <td><a href="<?php echo esc_url($protocol.$ad['url'])?>"><?php echo esc_html($ad['anchor'])?></a></td> 477 <td><?php echo esc_html($lw_humanloc) ?></td> 478 <td><?php echo ((!is_array($ad['description']) || !empty($ad['description'])) ? esc_html($ad['description']) : '');?></td> 479 479 </tr> 480 480 <?php … … 514 514 ?> 515 515 <tr> 516 <td><a href="<?php echo $ad['url'] ?>"><?php echo $ad['anchor']?></a></td>517 <td><?php echo $lw_humanloc?></td>518 <td><?php echo $ad['pagename'] ?> <?php echo $ad['description']?></td>516 <td><a href="<?php echo esc_url($ad['url']) ?>"><?php echo esc_html($ad['anchor']) ?></a></td> 517 <td><?php echo esc_html($lw_humanloc) ?></td> 518 <td><?php echo esc_html($ad['pagename']) ?> <?php echo esc_html($ad['description']) ?></td> 519 519 </tr> 520 520 <?php … … 553 553 ?> 554 554 <tr> 555 <td style="vertical-align:top;"><a href="<?php echo $protocol.$example_ad['url'] ?>" title="<?php echo $example_ad['description'] ?>"><?php echo $example_ad['anchor']?></a></td>556 <td style="vertical-align:top;"><?php echo $lw_humanloc?></td>555 <td style="vertical-align:top;"><a href="<?php echo esc_url($protocol.$example_ad['url']) ?>" title="<?php echo esc_attr($example_ad['description']) ?>"><?php echo esc_html($example_ad['anchor']) ?></a></td> 556 <td style="vertical-align:top;"><?php echo esc_html($lw_humanloc) ?></td> 557 557 <td> 558 558 <?php … … 564 564 $protocol = ($hyperlink['use_https'])? 'https://' : 'http://'; 565 565 ?> 566 <a href="<?php echo $protocol.$hyperlink['url'] ?>" title="<?php echo $hyperlink['description'] ?>"><?php echo $hyperlink['anchor']?></a><?php echo (($current_count < $hyperlink_count) ? ' ,' : '')?>566 <a href="<?php echo esc_url($protocol.$hyperlink['url']) ?>" title="<?php echo esc_attr($hyperlink['description']) ?>"><?php echo esc_html($hyperlink['anchor']) ?></a><?php echo (($current_count < $hyperlink_count) ? ' ,' : '')?> 567 567 <?php 568 568 $current_count++; … … 596 596 ?> 597 597 <tr> 598 <td><a href="<?php echo $protocol.$ad['url'] ?>"><?php echo $ad['anchor']?></a></td>599 <td><?php echo $ad['webpageurl']?></td>598 <td><a href="<?php echo esc_url($protocol.$ad['url']) ?>"><?php echo esc_html($ad['anchor']) ?></a></td> 599 <td><?php echo esc_html($ad['webpageurl']) ?></td> 600 600 <td></td> 601 601 </tr> … … 618 618 </tr> 619 619 </table> 620 <?php wp_nonce_field( 'update_general_settings_action', 'update_general_settings_field' ); ?> 620 621 </form> 621 622 </fieldset> … … 663 664 <div id="message" class="updated fade"> 664 665 <p style="font-weight:bold;"> 665 Your theme has <?php echo $loop_count ?> loop. 666 Your theme has <?php echo $loop_count ?> loop. 666 667 If you do not have a static page as your home page, your theme could be using more then one instance of 'The Loop.' 667 668 The number of loops could be higher then <?php echo $loop_count ?>. … … 693 694 <h2>LinkWorth Advanced Configuration</h2> 694 695 695 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']?>">696 <form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') ?>"> 696 697 <table cellspacing="0" cellpadding="0" class="widefat" style="width:auto;"> 697 698 <thead> … … 723 724 ?> 724 725 <select name="lw_ops[lw_linkscale]"> 725 <option value="px"<?php echo $lw_size_array_selected['px']?>>Pixels</option>726 <option value="pt"<?php echo $lw_size_array_selected['pt']?>>Points</option>727 <option value="em"<?php echo $lw_size_array_selected['em']?>>Ems</option>726 <option value="px"<?php echo esc_attr($lw_size_array_selected['px']) ?>>Pixels</option> 727 <option value="pt"<?php echo esc_attr($lw_size_array_selected['pt']) ?>>Points</option> 728 <option value="em"<?php echo esc_attr($lw_size_array_selected['em']) ?>>Ems</option> 728 729 </select> 729 730 </td> … … 770 771 771 772 <input type="hidden" name="updating_advanced_options" value="1" /> 773 <?php wp_nonce_field( 'update_advanced_options_action', 'update_advanced_options_field' ); ?> 772 774 </form> 773 775 </fieldset> -
linkworth-wp-plugin/trunk/readme.txt
r2750802 r2754739 4 4 Tags: ads, sidebar, post, content, ad, text links, links 5 5 Requires at least: 2.3 6 Tested up to: 5.97 Stable tag: 3.3 6 Tested up to: 6.0 7 Stable tag: 3.3.3 8 8 9 9 Easily publish different types of text link products and in-content ads from linkworth.com.
Note: See TracChangeset
for help on using the changeset viewer.