Changeset 2721774
- Timestamp:
- 05/11/2022 08:04:09 AM (4 years ago)
- Location:
- likebtn-like-button/tags/2.6.44
- Files:
-
- 6 edited
-
includes/tab_votes.php (modified) (8 diffs)
-
likebtn_like_button.php (modified) (44 diffs)
-
templates/like-box.php (modified) (2 diffs)
-
templates/liked-by-user-widget.php (modified) (5 diffs)
-
templates/most-liked-widget.php (modified) (5 diffs)
-
templates/um-liked-content.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
likebtn-like-button/tags/2.6.44/includes/tab_votes.php
r2721442 r2721774 115 115 <option value="">-- <?php _e('Any', 'likebtn-like-button'); ?> --</option> 116 116 <?php foreach ($likebtn_entities as $entity_name_value => $entity_title): ?> 117 <option value="<?php echo $entity_name_value; ?>" <?php selected($entity_name, $entity_name_value); ?> ><?php _e($entity_title, 'likebtn-like-button'); ?></option>117 <option value="<?php echo esc_attr($entity_name_value); ?>" <?php selected($entity_name, $entity_name_value); ?> ><?php echo esc_html(__($entity_title, 'likebtn-like-button')); ?></option> 118 118 <?php endforeach ?> 119 119 </select> … … 122 122 <div class="likebtn-form-group"> 123 123 <label><?php _e('Item ID', 'likebtn-like-button'); ?>:</label> 124 <input type="text" name="likebtn_post_id" value="<?php echo htmlspecialchars($post_id) ?>" size="10" />124 <input type="text" name="likebtn_post_id" value="<?php echo esc_attr($post_id) ?>" size="10" /> 125 125 </div> 126 126 <br/> 127 127 <div class="likebtn-form-group"> 128 128 <label><?php _e('User ID', 'likebtn-like-button'); ?>:</label> 129 <input type="text" name="likebtn_user_id" value="<?php echo htmlspecialchars($user_id) ?>" size="10" />129 <input type="text" name="likebtn_user_id" value="<?php echo esc_attr($user_id) ?>" size="10" /> 130 130 </div> 131 131 132 132 <div class="likebtn-form-group"> 133 133 <label><?php _e('IP'); ?>:</label> 134 <input type="text" name="likebtn_ip" value="<?php echo htmlspecialchars($ip) ?>" size="20"/>134 <input type="text" name="likebtn_ip" value="<?php echo esc_attr($ip) ?>" size="20"/> 135 135 </div> 136 136 … … 167 167 <select name="likebtn_blog_id" > 168 168 <?php foreach ($blogs as $blog_id_value => $blog_title): ?> 169 <option value="<?php echo $blog_id_value; ?>" <?php selected($votes_blog_id, $blog_id_value); ?> ><?php echo $blog_title; ?></option>169 <option value="<?php echo esc_attr($blog_id_value); ?>" <?php selected($votes_blog_id, $blog_id_value); ?> ><?php echo esc_html($blog_title); ?></option> 170 170 <?php endforeach ?> 171 171 </select> … … 175 175 <select name="likebtn_page_size" > 176 176 <?php foreach ($likebtn_page_sizes as $page_size_value): ?> 177 <option value="<?php echo $page_size_value; ?>" <?php selected($page_size, $page_size_value); ?> ><?php echo $page_size_value?></option>177 <option value="<?php echo esc_attr($page_size_value); ?>" <?php selected($page_size, $page_size_value); ?> ><?php echo esc_html($page_size_value) ?></option> 178 178 <?php endforeach ?> 179 179 … … 183 183 <input class="button-primary" type="submit" name="show" value="<?php _e('View', 'likebtn-like-button'); ?>" /> 184 184 185 <?php _e('Votes Found', 'likebtn-like-button'); ?>: <strong><?php echo $total_found?></strong>185 <?php _e('Votes Found', 'likebtn-like-button'); ?>: <strong><?php echo esc_html($total_found) ?></strong> 186 186 </nobr> 187 187 <?php if (count($votes) && $p->lastpage > 1): ?> … … 439 439 } 440 440 441 jQuery.getJSON('<?php echo admin_url('admin-ajax.php') ?>?action=likebtn_vgaph&nonce=<?php echo wp_create_nonce('likebtn_vgaph'); ?>&<?php echo $_SERVER['QUERY_STRING']?>', function(response) {441 jQuery.getJSON('<?php echo admin_url('admin-ajax.php') ?>?action=likebtn_vgaph&nonce=<?php echo wp_create_nonce('likebtn_vgaph'); ?>&<?php echo esc_url($_SERVER['QUERY_STRING']) ?>', function(response) { 442 442 443 443 if (!response.data) { … … 560 560 561 561 // Load data from server 562 jQuery.getJSON('<?php echo admin_url('admin-ajax.php') ?>?action=likebtn_vgaph&level='+level+'×tamp='+timestamp+'&nonce=<?php echo wp_create_nonce('likebtn_vgaph'); ?>&<?php echo $_SERVER['QUERY_STRING']?>', function(response) {562 jQuery.getJSON('<?php echo admin_url('admin-ajax.php') ?>?action=likebtn_vgaph&level='+level+'×tamp='+timestamp+'&nonce=<?php echo wp_create_nonce('likebtn_vgaph'); ?>&<?php echo esc_url($_SERVER['QUERY_STRING']) ?>', function(response) { 563 563 564 564 if (response.error_message) { … … 643 643 644 644 <div id="likebtn_export" class="likebtn_export hidden"> 645 <form action="<?php echo admin_url('admin-ajax.php') ?>?action=likebtn_export_votes&<?php echo $_SERVER['QUERY_STRING']?>" method="post" target="_blank">645 <form action="<?php echo admin_url('admin-ajax.php') ?>?action=likebtn_export_votes&<?php echo esc_url($_SERVER['QUERY_STRING']) ?>" method="post" target="_blank"> 646 646 <input type="hidden" name="export" value="1" /> 647 647 <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'likebtn_export_votes' ); ?>" /> -
likebtn-like-button/tags/2.6.44/likebtn_like_button.php
r2721442 r2721774 1800 1800 var likebtn_msg_f_submit2 = "<?php echo likebtn_esctr_msg(__('Submit and KEEP plugin active', 'likebtn-like-button')) ?>"; 1801 1801 var likebtn_msg_f_tmp = "<?php echo likebtn_esctr_msg(__('Deactivating for time being', 'likebtn-like-button')) ?>"; 1802 var likebtn_msg_f_offer1 = "<?php echo likebtn_esctr_msg(strtr(__('Here is your personal <strong style="font-size:20px;">%discount%% OFF</strong> coupon. Enter the code on %a_start%Upgrade%a_end% page and click Apply!', 'likebtn-like-button'), array('%discount%'=>65, '%a_start%'=>'<a href="'.__("https://likebtn.com/en/customer.php/upgrade/", 'likebtn-like-button')."?site_id=".get_option('likebtn_site_id')."&engine=wordpress&add_website=". $_SERVER['SERVER_NAME'].'" target="_blank">', '%a_end%'=>'</a>'))) ?>";1802 var likebtn_msg_f_offer1 = "<?php echo likebtn_esctr_msg(strtr(__('Here is your personal <strong style="font-size:20px;">%discount%% OFF</strong> coupon. Enter the code on %a_start%Upgrade%a_end% page and click Apply!', 'likebtn-like-button'), array('%discount%'=>65, '%a_start%'=>'<a href="'.__("https://likebtn.com/en/customer.php/upgrade/", 'likebtn-like-button')."?site_id=".get_option('likebtn_site_id')."&engine=wordpress&add_website=".esc_attr($_SERVER['SERVER_NAME']).'" target="_blank">', '%a_end%'=>'</a>'))) ?>"; 1803 1803 var likebtn_msg_f_offer2 = "<?php echo __("Enjoy!", 'likebtn-like-button') ?>"; 1804 1804 </script> … … 1851 1851 function likebtn_admin_header() { 1852 1852 $logo_url = _likebtn_get_public_url() . 'img/logo.png'; 1853 $header = <<<HEADER 1854 <div class="wrap" id="likebtn"> 1855 HEADER; 1856 1857 $header .= ' 1853 1854 $header = '<div class="wrap" id="likebtn"> 1858 1855 <div id="poststuff"> 1859 1856 <div id="post-body" class="metabox-holder columns-2"> … … 1863 1860 <div class="postbox likebtn_logo"> 1864 1861 <div class="inside likebtn_sidebar_inside"> 1865 <a href="https://likebtn.com/en/wordpress-like-button-plugin" target="_blank" title="LikeBtn.com"><img alt="" src="'. $logo_url.'" /></a>1862 <a href="https://likebtn.com/en/wordpress-like-button-plugin" target="_blank" title="LikeBtn.com"><img alt="" src="'.esc_url($logo_url).'" /></a> 1866 1863 <input type="submit" id="likebtn_contact" value="' . __('Contact Us', 'likebtn-like-button') . '" class="button-primary" onclick="likebtnContactUs()"> 1867 1864 </div> … … 1976 1973 <div id="likebtn_trial_info" class="likebtn_sidebar_section"> 1977 1974 <a href="javascript:jQuery(\'#likebtn_trial_help\').toggle();void(0);">'.__('What is TRIAL?', 'likebtn-like-button').'</a> 1978 <div id="likebtn_trial_help" style="display:none"><br/>'.strtr(__('During the TRIAL period you can enjoy ULTRA features for 7 days. After TRIAL expires your website is switched to the %a_begin%FREE%a_end% plan (all the votes will be kept!) and you can continue using FREE plan or go Premium.', 'likebtn-like-button'), array('%a_begin%'=>'<a href="javascript:likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&engine=wordpress&add_website='. $_SERVER['SERVER_NAME'].'\');void(0);">', '%a_end%'=>'</a>')).'</div>1975 <div id="likebtn_trial_help" style="display:none"><br/>'.strtr(__('During the TRIAL period you can enjoy ULTRA features for 7 days. After TRIAL expires your website is switched to the %a_begin%FREE%a_end% plan (all the votes will be kept!) and you can continue using FREE plan or go Premium.', 'likebtn-like-button'), array('%a_begin%'=>'<a href="javascript:likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&engine=wordpress&add_website='.esc_attr($_SERVER['SERVER_NAME']).'\');void(0);">', '%a_end%'=>'</a>')).'</div> 1979 1976 </div>'; 1980 1977 } … … 2019 2016 2020 2017 //if ($plan_synced && $likebtn_plan != LIKEBTN_PLAN_ULTRA) { 2021 $html .= '<input class="button-secondary likebtn_button_upgrade" type="button" value="'.__('Upgrade', 'likebtn-like-button').'" onclick="likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&engine=wordpress&add_website='. $_SERVER['SERVER_NAME'].'\')" /> ';2018 $html .= '<input class="button-secondary likebtn_button_upgrade" type="button" value="'.__('Upgrade', 'likebtn-like-button').'" onclick="likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&engine=wordpress&add_website='.esc_attr($_SERVER['SERVER_NAME']).'\')" /> '; 2022 2019 //} 2023 2020 if ($plan_synced && $likebtn_plan != LIKEBTN_PLAN_FREE && $likebtn_plan != LIKEBTN_PLAN_TRIAL) { 2024 $html .= '<small><a href="javascript:likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&prolong=1&engine=wordpress&add_website='. $_SERVER['SERVER_NAME'].'\');void(0);">'.__('Renew Plan', 'likebtn-like-button').'</a></small>';2021 $html .= '<small><a href="javascript:likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&prolong=1&engine=wordpress&add_website='.esc_attr($_SERVER['SERVER_NAME']).'\');void(0);">'.__('Renew Plan', 'likebtn-like-button').'</a></small>'; 2025 2022 } else { 2026 $html .= '<small><a href="javascript:likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&engine=wordpress&add_website='. $_SERVER['SERVER_NAME'].'\');void(0);">'.__('Plans & Pricing', 'likebtn-like-button').'</a></small>';2023 $html .= '<small><a href="javascript:likebtnPopup(\''.__('https://likebtn.com/en/customer.php/upgrade/', 'likebtn-like-button').'?site_id='.get_option('likebtn_site_id').'&engine=wordpress&add_website='.esc_attr($_SERVER['SERVER_NAME']).'\');void(0);">'.__('Plans & Pricing', 'likebtn-like-button').'</a></small>'; 2027 2024 } 2028 2025 $html .= '</div>'; … … 2068 2065 } 2069 2066 2070 // sidebar social2071 function _likebtn_sidebar_social()2072 {2073 $html =<<<HTML2074 <div class="likebtn_social">2075 <iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FLikeBtn.LikeButton&width&layout=button_count&action=like&show_faces=false&share=false&height=21&appId=192115980991078" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px; width:110px;" allowTransparency="true"></iframe>2076 </div>2077 <div class="likebtn_social">2078 <a href="https://twitter.com/likebtn" class="twitter-follow-button" data-show-count="true" data-show-screen-name="false" data-width="144px"></a>2079 <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>2080 </div>2081 HTML;2082 2083 return $html;2084 }2085 2086 2067 // sidebar Referral Program 2087 2068 function _likebtn_sidebar_rp() 2088 2069 { 2089 $public_url = _likebtn_get_public_url(); 2090 $title = __('Earn Money With LikeBtn!', 'likebtn-like-button'); 2091 $href = "javascript:likebtnPopup('".__('https://likebtn.com/en/', 'likebtn-like-button')."referral-program');void(0)"; 2092 2093 $html =<<<HTML 2094 <center><a href="{$href}" class="likebtn_ttip" title="{$title}" style="display:block"><img src="{$public_url}img/rp.png" style="max-width:60%"/></a></center> 2095 HTML; 2070 $html = '<center><a href="javascript:likebtnPopup(\''.__('https://likebtn.com/en/', 'likebtn-like-button').'referral-program\');void(0)" class="likebtn_ttip" title="'.__('Earn Money With LikeBtn!', 'likebtn-like-button').'" style="display:block"><img src="'._likebtn_get_public_url().'img/rp.png" style="max-width:60%"/></a></center>'; 2096 2071 2097 2072 return $html; … … 2116 2091 2117 2092 if (isset($likebtn_plans[$likebtn_plan]) && $plan_synced) { 2118 // <a href="javascript: likebtnPopup(\''.__('http://likebtn.com/en/', 'likebtn-like-button').'?add_website='. $_SERVER['SERVER_NAME'].'#plans_pricing\'); void(0)" class="likebtn_ttip" title="'.__('Plans & Pricing', 'likebtn-like-button').'"><strong>'.$likebtn_plans[$likebtn_plan].'</strong></a>2093 // <a href="javascript: likebtnPopup(\''.__('http://likebtn.com/en/', 'likebtn-like-button').'?add_website='.esc_attr($_SERVER['SERVER_NAME']).'#plans_pricing\'); void(0)" class="likebtn_ttip" title="'.__('Plans & Pricing', 'likebtn-like-button').'"><strong>'.$likebtn_plans[$likebtn_plan].'</strong></a> 2119 2094 $plan_html = '<strong>'.$likebtn_plans[$likebtn_plan].'</strong>'.$refresh_html; 2120 2095 … … 2573 2548 2574 2549 // Poll 2575 $script = basename( $_SERVER['REQUEST_URI']);2550 $script = basename(sanitize_text_field($_SERVER['REQUEST_URI'])); 2576 2551 if (!$script) { 2577 $script = basename( $_SERVER['SCRIPT_NAME']);2552 $script = basename(sanitize_text_field($_SERVER['SCRIPT_NAME'])); 2578 2553 } 2579 2554 if (!$script) { 2580 $script = basename( $_SERVER['SCRIPT_FILENAME']);2555 $script = basename(sanitize_text_field($_SERVER['SCRIPT_FILENAME'])); 2581 2556 } 2582 2557 $script = preg_replace("/\?.*/", '', $script); … … 2661 2636 <select name="likebtn_entity_name" > 2662 2637 <?php foreach ($likebtn_entities as $entity_name_value => $entity_title): ?> 2663 <option value="<?php echo esc_attr($entity_name_value); ?>" <?php selected($entity_name, $entity_name_value); ?> ><?php _e($entity_title, 'likebtn-like-button'); ?></option>2638 <option value="<?php echo esc_attr($entity_name_value); ?>" <?php selected($entity_name, $entity_name_value); ?> ><?php echo esc_html(__($entity_title, 'likebtn-like-button')); ?></option> 2664 2639 <?php endforeach ?> 2665 2640 </select></nobr> … … 2678 2653 <div class="inside"> 2679 2654 <label><?php _e('ID', 'likebtn-like-button'); ?>:</label> 2680 <input type="text" name="likebtn_post_id" value="<?php echo htmlspecialchars($post_id) ?>" size="5" />2655 <input type="text" name="likebtn_post_id" value="<?php echo esc_attr($post_id) ?>" size="5" /> 2681 2656 2682 2657 <label><?php _e('Title'); ?>:</label> 2683 <input type="text" name="likebtn_post_title" value="<?php echo htmlspecialchars($post_title) ?>" size="25"/>2658 <input type="text" name="likebtn_post_title" value="<?php echo esc_attr($post_title) ?>" size="25"/> 2684 2659 2685 2660 <label><?php _e('Status', 'likebtn-like-button'); ?>:</label> … … 2687 2662 <option value=""></option> 2688 2663 <?php foreach ($likebtn_post_statuses as $post_status_value => $post_status_title): ?> 2689 <option value="<?php echo esc_attr($post_status_value); ?>" <?php selected($post_status, $post_status_value); ?> ><?php echo _e($post_status_title) ?></option>2664 <option value="<?php echo esc_attr($post_status_value); ?>" <?php selected($post_status, $post_status_value); ?> ><?php echo esc_html(__($post_status_title)) ?></option> 2690 2665 <?php endforeach ?> 2691 2666 </select> … … 3579 3554 } 3580 3555 3556 $items = array(); 3557 foreach ($_POST['item'] as $item) { 3558 $items[] = sanitize_text_field($item); 3559 } 3560 3581 3561 switch ($_POST['bulk_action']) { 3582 3562 case 'reset': 3583 3563 // $_POST['item'] must be able to contain any symbols 3584 $reseted = _likebtn_reset($entity_name, sanitize_text_field($_POST['item']));3564 $reseted = _likebtn_reset($entity_name, $items); 3585 3565 _likebtn_add_notice(array( 3586 3566 'msg' => __('Likes and dislikes for the following number of items have been successfully reseted:', 'likebtn-like-button').' '.$reseted, … … 3590 3570 case 'delete': 3591 3571 // $_POST['item'] must be able to contain any symbols 3592 $reseted = _likebtn_delete($entity_name, sanitize_text_field($_POST['item']));3572 $reseted = _likebtn_delete($entity_name, $items); 3593 3573 _likebtn_add_notice(array( 3594 3574 'msg' => __('The following number of items have been successfully deleted:', 'likebtn-like-button').' '.$reseted, … … 3601 3581 } 3602 3582 3603 wp_redirect( $_SERVER['REQUEST_URI']);3583 wp_redirect(sanitize_url($_SERVER['REQUEST_URI'])); 3604 3584 exit(); 3605 3585 } … … 4166 4146 $identifier = _likebtn_entity_to_identifier($entity_name, $entity_id); 4167 4147 } 4168 $data = ' data-identifier="' . $identifier. '" ';4148 $data = ' data-identifier="' . esc_attr($identifier) . '" '; 4169 4149 4170 4150 // Site ID 4171 4151 if (get_option('likebtn_site_id')) { 4172 $data .= ' data-site_id="' . get_option('likebtn_site_id') . '" ';4152 $data .= ' data-site_id="' . esc_attr(get_option('likebtn_site_id')) . '" '; 4173 4153 } 4174 4154 … … 4176 4156 if (_likebtn_get_option($use_entity_name, 'likebtn_user_logged_in', $values) == LIKEBTN_USER_LOGGED_IN_MODAL && !is_user_logged_in()) { 4177 4157 $values['voting_enabled'] = '0'; 4178 $data .= ' data-clk_modal="' . htmlspecialchars(_likebtn_get_user_logged_in_alert($use_entity_name)) . '" ';4158 $data .= ' data-clk_modal="' . esc_attr(htmlspecialchars(_likebtn_get_user_logged_in_alert($use_entity_name))) . '" '; 4179 4159 } 4180 4160 … … 4262 4242 $values['group_identifier'] = $entity_name; 4263 4243 } 4264 4265 4244 4266 4245 $likebtn_settings = _likebtn_get_all_settings(); … … 4294 4273 $option_value_prepared = likebtn_cur_lang(); 4295 4274 } 4296 $data .= ' data-' . $option_name . '="' . $option_value_prepared. '" ';4275 $data .= ' data-' . $option_name . '="' . esc_attr($option_value_prepared) . '" '; 4297 4276 } 4298 4277 } … … 4300 4279 // Add item options 4301 4280 if ($entity_url && !$prepared_settings['item_url']) { 4302 $data .= ' data-item_url="' . $entity_url. '" ';4281 $data .= ' data-item_url="' . esc_attr($entity_url) . '" '; 4303 4282 } 4304 4283 if ($entity_title && !$prepared_settings['item_title']) { … … 4307 4286 $entity_title = htmlspecialchars($entity_title); 4308 4287 4309 $data .= ' data-item_title="' . $entity_title. '" ';4288 $data .= ' data-item_title="' . esc_attr($entity_title) . '" '; 4310 4289 } 4311 4290 if ($entity_image && !$prepared_settings['item_image']) { 4312 $data .= ' data-item_image="' . $entity_image. '" ';4291 $data .= ' data-item_image="' . esc_attr($entity_image) . '" '; 4313 4292 } 4314 4293 if ($entity_date && !$prepared_settings['item_date']) { 4315 $data .= ' data-item_date="' . $entity_date. '" ';4294 $data .= ' data-item_date="' . esc_attr($entity_date) . '" '; 4316 4295 } 4317 4296 … … 4320 4299 $vt = _likebtn_get_vote_type($identifier, $prepared_settings['voting_frequency']); 4321 4300 if ($vt) { 4322 $data .= ' data-vt="'. $vt.'" ';4301 $data .= ' data-vt="'.esc_attr($vt).'" '; 4323 4302 } 4324 4303 } … … 4329 4308 $plugin_v = LIKEBTN_VERSION; 4330 4309 if ($plugin_v) { 4331 $data .= ' data-plugin_v="' . $plugin_v. '" ';4310 $data .= ' data-plugin_v="' . esc_attr($plugin_v) . '" '; 4332 4311 } 4333 4312 … … 4341 4320 } 4342 4321 4343 $data .= ' data-prx="' . $prx. '" ';4322 $data .= ' data-prx="' . esc_attr($prx) . '" '; 4344 4323 } 4345 4324 // Event handler … … 4355 4334 $widget_url = LIKEBTN_WIDGET_URL; 4356 4335 if ($include_script) { 4357 $markup = <<<MARKUP 4358 <!-- LikeBtn.com BEGIN --><span class="likebtn-wrapper" {$data}></span><script>(function(d, e, s) {a = d.createElement(e);m = d.getElementsByTagName(e)[0];a.async = 1;a.src = s;m.parentNode.insertBefore(a, m)})(document, 'script', '//{$widget_url}'); if (typeof(LikeBtn) != "undefined") { LikeBtn.init(); }</script><!-- LikeBtn.com END --> 4359 MARKUP; 4336 // $data is prepared and escaped above 4337 $markup = '<!-- LikeBtn.com BEGIN --><span class="likebtn-wrapper" '.$data.'></span><script>(function(d, e, s) {a = d.createElement(e);m = d.getElementsByTagName(e)[0];a.async = 1;a.src = s;m.parentNode.insertBefore(a, m)})(document, \'script\', \'//'.esc_attr($widget_url).'\'); if (typeof(LikeBtn) != "undefined") { LikeBtn.init(); }</script><!-- LikeBtn.com END -->'; 4360 4338 } else { 4361 $markup = <<<MARKUP 4362 <!-- LikeBtn.com BEGIN --><span class="likebtn-wrapper" {$data}></span><!-- LikeBtn.com END --> 4363 MARKUP; 4339 // $data is prepared and escaped above 4340 $markup = '<!-- LikeBtn.com BEGIN --><span class="likebtn-wrapper" '.$data.'></span><!-- LikeBtn.com END -->'; 4364 4341 } 4365 4342 … … 4372 4349 } 4373 4350 $html_before = apply_filters('likebtn_html_before', $html_before, $entity_name, $entity_id, $values); 4374 $markup = $html_before. $markup;4351 $markup = wp_kses($html_before, 'post') . $markup; 4375 4352 4376 4353 … … 4384 4361 4385 4362 $html_after = apply_filters('likebtn_html_after', $html_after, $entity_name, $entity_id, $values); 4386 $markup = $markup . $html_after;4363 $markup = $markup . wp_kses($html_after, 'post'); 4387 4364 4388 4365 if (($wrap || !empty($values['wrap']) || !empty($values['alignment']) || !empty($values['newline'])) && !is_admin()) { … … 4402 4379 if ($alignment == LIKEBTN_ALIGNMENT_RIGHT) { 4403 4380 $style .= 'text-align:right;'; 4404 $markup = '<div class="likebtn_container" style="'. $style.'">' . $markup . '</div>';4381 $markup = '<div class="likebtn_container" style="'.esc_attr($style).'">' . $markup . '</div>'; 4405 4382 } elseif ($alignment == LIKEBTN_ALIGNMENT_CENTER) { 4406 4383 $style .= 'text-align:center;'; 4407 $markup = '<div class="likebtn_container" style="'. $style.'">' . $markup . '</div>';4384 $markup = '<div class="likebtn_container" style="'.esc_attr($style).'">' . $markup . '</div>'; 4408 4385 } else { 4409 $markup = '<div class="likebtn_container" style="'. $style.'">' . $markup . '</div>';4386 $markup = '<div class="likebtn_container" style="'.esc_attr($style).'">' . $markup . '</div>'; 4410 4387 } 4411 4388 } … … 5182 5159 ); 5183 5160 5161 // Options sanitizing is done in likebtn_send_vote_notification() function 5184 5162 $result = likebtn_send_vote_notification($vars, stripslashes_deep($_POST['options'])); 5185 5163 … … 6871 6849 $client_identifier = $user_id; 6872 6850 } else { 6851 // $_SERVER do not need sanitizing here, we need them intact in md5 function(); 6873 6852 $client_identifier = md5($ip.$_SERVER['HTTP_USER_AGENT'].$_SERVER['HTTP_ACCEPT'].$_SERVER['HTTP_ACCEPT_LANGUAGE']); 6874 6853 } … … 7117 7096 // If suhosin.get.max_value_length is set 7118 7097 $_GET = array(); 7119 $params = explode('&', $_SERVER['QUERY_STRING']);7098 $params = explode('&', sanitize_text_field($_SERVER['QUERY_STRING'])); 7120 7099 foreach ($params as $pair) { 7121 7100 list($key, $value) = explode('=', $pair); … … 7174 7153 try { 7175 7154 $http = new WP_Http(); 7155 // S_SERVER vars do not need sanitizing here - we pass them as is to the external system 7176 7156 $headers = array( 7177 7157 "User-Agent" => $_SERVER['HTTP_USER_AGENT'], … … 7724 7704 // global $likebtn_cf_ip_ranges_ipv6; 7725 7705 7726 $ip = $_SERVER['REMOTE_ADDR'];7706 $ip = sanitize_text_field($_SERVER['REMOTE_ADDR']); 7727 7707 7728 7708 // Behind CloudFlare … … 7733 7713 foreach ($likebtn_cf_ip_ranges_ipv6 as $range) { 7734 7714 if (_likebtn_ip_in_range_ipv6($ip, $range)) { 7735 return $_SERVER['HTTP_CF_CONNECTING_IP'];7715 return sanitize_text_field($_SERVER['HTTP_CF_CONNECTING_IP']); 7736 7716 } 7737 7717 } … … 7741 7721 foreach ($likebtn_cf_ip_ranges as $range) { 7742 7722 if (_likebtn_ip_in_range($ip, $range)) { 7743 return $_SERVER['HTTP_CF_CONNECTING_IP'];7723 return sanitize_text_field($_SERVER['HTTP_CF_CONNECTING_IP']); 7744 7724 } 7745 7725 } … … 7751 7731 } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { 7752 7732 if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') > 0) { 7753 $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);7733 $addr = explode(",", sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR'])); 7754 7734 $x_ip = trim($addr[0]); 7755 7735 } else { 7756 $x_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];7736 $x_ip = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']); 7757 7737 } 7758 7738 if ($x_ip != $_SERVER['SERVER_ADDR']) { … … 7760 7740 } 7761 7741 } else { 7762 $ip = $_SERVER['REMOTE_ADDR'];7742 $ip = sanitize_text_field($_SERVER['REMOTE_ADDR']); 7763 7743 } 7764 7744 … … 7979 7959 function likebtn_build_sort_by($sort_by, $order) 7980 7960 { 7981 parse_str( $_SERVER['QUERY_STRING'], $args);7961 parse_str(sanitize_text_field($_SERVER['QUERY_STRING']), $args); 7982 7962 $args['likebtn_sort_by'] = $sort_by; 7983 7963 $args['likebtn_sort_by_order'] = $order; … … 7988 7968 function likebtn_get_script_name() 7989 7969 { 7990 $script_name = $_SERVER['SCRIPT_NAME'];7970 $script_name = sanitize_text_field($_SERVER['SCRIPT_NAME']); 7991 7971 if (!$script_name) { 7992 $script_name = $_SERVER['SCRIPT_URL'];7972 $script_name = sanitize_text_field($_SERVER['SCRIPT_URL']); 7993 7973 } 7994 7974 if (!$script_name) { 7995 $script_name = $_SERVER['PHP_SELF'];7975 $script_name = sanitize_text_field($_SERVER['PHP_SELF']); 7996 7976 } 7997 7977 return $script_name; … … 8437 8417 function likebtn_default_notify_text() 8438 8418 { 8439 $text = <<<TEXT8419 $text = ' 8440 8420 New {vote_type} on {domain} 8441 8421 … … 8448 8428 IP address: <a href="{vote_ip_url}">{vote_ip}</a> 8449 8429 User: <a href="{user_url}">{user_login}</a> <small>(<a href="{user_votes_url}">view user votes</a>)</small> 8450 TEXT;8430 '; 8451 8431 return $text; 8452 8432 } … … 8468 8448 'error_message' => '' 8469 8449 ); 8450 8451 if (!is_array($options)) { 8452 $options = array(); 8453 } 8470 8454 8471 8455 if (!empty($options['likebtn_notify_to'])) { … … 8481 8465 return $return; 8482 8466 } 8467 // Sanitize emails. 8468 foreach ($to_emails as $i => $email) { 8469 $to_emails[$i] = sanitize_email($email); 8470 } 8483 8471 8484 8472 if (!empty($options['likebtn_notify_from'])) { 8485 $from = $options['likebtn_notify_from'];8473 $from = sanitize_email($options['likebtn_notify_from']); 8486 8474 } else { 8487 8475 $from = get_option('likebtn_notify_from'); … … 8493 8481 8494 8482 if (!empty($options['likebtn_notify_subject'])) { 8495 $subject = $options['likebtn_notify_subject'];8483 $subject = sanitize_text_field($options['likebtn_notify_subject']); 8496 8484 } else { 8497 8485 $subject = get_option('likebtn_notify_subject'); … … 8503 8491 8504 8492 if (!empty($options['likebtn_notify_text'])) { 8505 $template = $options['likebtn_notify_text'];8493 $template = sanitize_textarea_field($options['likebtn_notify_text']); 8506 8494 } else { 8507 8495 $template = get_option('likebtn_notify_text'); -
likebtn-like-button/tags/2.6.44/templates/like-box.php
r2719548 r2721774 13 13 <?php if ($text): ?> 14 14 <div class="likebtn-likebox-txt"> 15 <?php echo $text; ?>15 <?php echo wp_kses($text, 'post'); ?> 16 16 </div> 17 17 <?php endif ?> … … 19 19 <?php foreach ($user_loop as $user): ?> 20 20 <div class="likebtn-likebox-user" > 21 <a href="<?php echo $user['url']?>" title="<?php echo $user['name'] ?>" class="likebtn-likebox-lnk"><img width="32" height="32" alt="<?php echo $user['name'] ?>" class="avatar avatar-32 user-<?php echo $user['user_id']?>-avatar gravatar" src="<?php echo $user['avatar']?>"></a>21 <a href="<?php echo esc_attr($user['url']) ?>" title="<?php echo esc_attr($user['name']) ?>" class="likebtn-likebox-lnk"><img width="32" height="32" alt="<?php echo esc_attr($user['name']) ?>" class="avatar avatar-32 user-<?php echo esc_attr($user['user_id']) ?>-avatar gravatar" src="<?php echo esc_attr($user['avatar']) ?>"></a> 22 22 </div> 23 23 <?php endforeach; ?> -
likebtn-like-button/tags/2.6.44/templates/liked-by-user-widget.php
r2719548 r2721774 10 10 11 11 <?php if (!empty($before_widget)): ?> 12 <?php echo $before_widget; ?>12 <?php echo wp_kses($before_widget, 'post'); ?> 13 13 <?php endif ?> 14 14 15 15 <?php if (!empty($title)): ?> 16 16 <?php if (!empty($before_title)): ?> 17 <?php echo $before_title; ?>17 <?php echo wp_kses($before_title, 'post'); ?> 18 18 <?php endif ?> 19 <?php echo $title; ?>19 <?php echo wp_kses($title, 'post'); ?> 20 20 <?php if (!empty($after_title)): ?> 21 <?php echo $after_title; ?>21 <?php echo wp_kses($after_title, 'post'); ?> 22 22 <?php endif ?> 23 23 <?php endif ?> … … 26 26 <ul class="likebtn-mlw"> 27 27 <?php foreach ($post_loop as $post): ?> 28 <li id="post-<?php echo $post['id']?>" class="likebtn-mlw-item" >29 <a href="<?php echo $post['link'] ?>" title="<?php echo $post['title']?>">28 <li id="post-<?php echo esc_attr($post['id']) ?>" class="likebtn-mlw-item" > 29 <a href="<?php echo esc_attr($post['link']) ?>" title="<?php echo esc_attr($post['title']) ?>"> 30 30 <?php if ($show_thumbnail): ?> 31 31 <?php if ('image/' == substr( $post['post_mime_type'], 0, 6 ) ): ?> … … 36 36 <?php endif ?> 37 37 <div class="likebtn-mlw-title"> 38 <?php echo $post['title']?><?php if ($show_likes || $show_dislikes): ?> <span class="likebtn-item-likes"><nobr>(38 <?php echo esc_html($post['title']) ?><?php if ($show_likes || $show_dislikes): ?> <span class="likebtn-item-likes"><nobr>( 39 39 <?php endif ?> 40 <?php echo $show_likes ? $post['likes'] : ''; ?>40 <?php echo $show_likes ? (int)$post['likes'] : ''; ?> 41 41 <?php if ($show_likes && $show_dislikes): ?> 42 42 / 43 43 <?php endif ?> 44 <?php echo $show_dislikes ? $post['dislikes'] : ''; ?>44 <?php echo $show_dislikes ? (int)$post['dislikes'] : ''; ?> 45 45 <?php if ($show_likes || $show_dislikes): ?> 46 46 )</nobr></span> … … 55 55 <small>/</small> 56 56 <?php endif ?> 57 <small class="likebtn-mlw-author"><i><?php echo $post['author_name']?></i></small>57 <small class="likebtn-mlw-author"><i><?php echo esc_html($post['author_name']) ?></i></small> 58 58 <?php endif ?> 59 59 <?php if ($show_excerpt): ?> 60 <div class="likebtn-mlw-excerpt"><?php echo $post['excerpt']?></div>60 <div class="likebtn-mlw-excerpt"><?php echo esc_html($post['excerpt']) ?></div> 61 61 <?php endif ?> 62 62 <?php if ($post['button_html']): ?> 63 <div class="likebtn-mlw-button"><?php echo $post['button_html']; ?></div>63 <div class="likebtn-mlw-button"><?php echo wp_kses($post['button_html'], 'post'); ?></div> 64 64 <?php endif ?> 65 65 <?php if ($show_thumbnail || $show_excerpt): ?> … … 78 78 79 79 <?php if (!empty($after_widget)): ?> 80 <?php echo $after_widget; ?>80 <?php echo wp_kses($after_widget, 'post'); ?> 81 81 <?php endif ?> -
likebtn-like-button/tags/2.6.44/templates/most-liked-widget.php
r2719548 r2721774 10 10 11 11 <?php if (!empty($before_widget)): ?> 12 <?php echo $before_widget; ?>12 <?php echo wp_kses($before_widget, 'post'); ?> 13 13 <?php endif ?> 14 14 15 15 <?php if (!empty($title)): ?> 16 16 <?php if (!empty($before_title)): ?> 17 <?php echo $before_title; ?>17 <?php echo wp_kses($before_title, 'post'); ?> 18 18 <?php endif ?> 19 <?php echo $title; ?>19 <?php echo wp_kses($title, 'post'); ?> 20 20 <?php if (!empty($after_title)): ?> 21 <?php echo $after_title; ?>21 <?php echo wp_kses($after_title, 'post'); ?> 22 22 <?php endif ?> 23 23 <?php endif ?> … … 26 26 <ul class="likebtn-mlw"> 27 27 <?php foreach ($post_loop as $post): ?> 28 <li id="post-<?php echo $post['id']?>" class="likebtn-mlw-item" >29 <a href="<?php echo $post['link']?>" title="<?php echo esc_attr($post['title']) ?>">28 <li id="post-<?php echo esc_attr($post['id']) ?>" class="likebtn-mlw-item" > 29 <a href="<?php echo esc_attr($post['link']) ?>" title="<?php echo esc_attr($post['title']) ?>"> 30 30 <?php if ($show_thumbnail): ?> 31 31 <?php if ('image/' == substr( $post['post_mime_type'], 0, 6 ) ): ?> … … 36 36 <?php endif ?> 37 37 <div class="likebtn-mlw-title"> 38 <?php echo $post['title']?><?php if ($show_likes || $show_dislikes): ?> <span class="likebtn-item-likes"><nobr>(38 <?php echo esc_html($post['title']) ?><?php if ($show_likes || $show_dislikes): ?> <span class="likebtn-item-likes"><nobr>( 39 39 <?php endif ?> 40 <?php echo $show_likes ? $post['likes'] : ''; ?>40 <?php echo $show_likes ? (int)$post['likes'] : ''; ?> 41 41 <?php if ($show_likes && $show_dislikes): ?> 42 42 / 43 43 <?php endif ?> 44 <?php echo $show_dislikes ? $post['dislikes'] : ''; ?>44 <?php echo $show_dislikes ? (int)$post['dislikes'] : ''; ?> 45 45 <?php if ($show_likes || $show_dislikes): ?> 46 46 )</nobr></span> … … 55 55 <small>/</small> 56 56 <?php endif ?> 57 <small class="likebtn-mlw-author"><i><?php echo $post['author_name']?></i></small>57 <small class="likebtn-mlw-author"><i><?php echo esc_html($post['author_name']) ?></i></small> 58 58 <?php endif ?> 59 59 <?php if ($show_excerpt): ?> 60 <div class="likebtn-mlw-excerpt"><?php echo $post['excerpt']?></div>60 <div class="likebtn-mlw-excerpt"><?php echo esc_html($post['excerpt']) ?></div> 61 61 <?php endif ?> 62 62 <?php if ($post['button_html']): ?> 63 <div class="likebtn-mlw-button"><?php echo $post['button_html']; ?></div>63 <div class="likebtn-mlw-button"><?php echo wp_kses($post['button_html'], 'post'); ?></div> 64 64 <?php endif ?> 65 65 <?php if ($show_thumbnail || $show_excerpt): ?> … … 84 84 85 85 <?php if (!empty($after_widget)): ?> 86 <?php echo $after_widget; ?>86 <?php echo wp_kses($after_widget, 'post'); ?> 87 87 <?php endif ?> -
likebtn-like-button/tags/2.6.44/templates/um-liked-content.php
r2719548 r2721774 22 22 <i class="um-icon-ios-paper"></i> 23 23 <?php endif ?> 24 <a href="<?php echo $post['link'] ?>"><?php echo $post['title']?></a>24 <a href="<?php echo esc_attr($post['link']) ?>"><?php echo esc_html($post['title']) ?></a> 25 25 </div> 26 26 <div class="um-item-meta">
Note: See TracChangeset
for help on using the changeset viewer.