Changeset 2746542
- Timestamp:
- 06/22/2022 04:29:42 PM (4 years ago)
- Location:
- sharebar
- Files:
-
- 44 added
- 3 edited
-
tags/1.4.3 (added)
-
tags/1.4.3/css (added)
-
tags/1.4.3/css/colorpicker.css (added)
-
tags/1.4.3/css/sharebar.css (added)
-
tags/1.4.3/images (added)
-
tags/1.4.3/images/blank.gif (added)
-
tags/1.4.3/images/colorpicker_background.png (added)
-
tags/1.4.3/images/colorpicker_hex.png (added)
-
tags/1.4.3/images/colorpicker_hsb_b.png (added)
-
tags/1.4.3/images/colorpicker_hsb_h.png (added)
-
tags/1.4.3/images/colorpicker_hsb_s.png (added)
-
tags/1.4.3/images/colorpicker_indic.gif (added)
-
tags/1.4.3/images/colorpicker_overlay.png (added)
-
tags/1.4.3/images/colorpicker_rgb_b.png (added)
-
tags/1.4.3/images/colorpicker_rgb_g.png (added)
-
tags/1.4.3/images/colorpicker_rgb_r.png (added)
-
tags/1.4.3/images/colorpicker_select.gif (added)
-
tags/1.4.3/images/colorpicker_submit.png (added)
-
tags/1.4.3/images/custom_background.png (added)
-
tags/1.4.3/images/custom_hex.png (added)
-
tags/1.4.3/images/custom_hsb_b.png (added)
-
tags/1.4.3/images/custom_hsb_h.png (added)
-
tags/1.4.3/images/custom_hsb_s.png (added)
-
tags/1.4.3/images/custom_indic.gif (added)
-
tags/1.4.3/images/custom_rgb_b.png (added)
-
tags/1.4.3/images/custom_rgb_g.png (added)
-
tags/1.4.3/images/custom_rgb_r.png (added)
-
tags/1.4.3/images/custom_submit.png (added)
-
tags/1.4.3/images/down.gif (added)
-
tags/1.4.3/images/select.png (added)
-
tags/1.4.3/images/select2.png (added)
-
tags/1.4.3/images/slider.png (added)
-
tags/1.4.3/images/up.gif (added)
-
tags/1.4.3/js (added)
-
tags/1.4.3/js/colorpicker.js (added)
-
tags/1.4.3/js/sharebar-admin.js (added)
-
tags/1.4.3/js/sharebar.js (added)
-
tags/1.4.3/readme.txt (added)
-
tags/1.4.3/screenshot-1.gif (added)
-
tags/1.4.3/screenshot-2.gif (added)
-
tags/1.4.3/screenshot-3.gif (added)
-
tags/1.4.3/screenshot-4.gif (added)
-
tags/1.4.3/sharebar-admin.php (added)
-
tags/1.4.3/sharebar.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sharebar-admin.php (modified) (5 diffs)
-
trunk/sharebar.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sharebar/trunk/readme.txt
r2745551 r2746542 4 4 Requires at least: 2.0 5 5 Tested up to: 6.0 6 Stable tag: 1.4. 26 Stable tag: 1.4.3 7 7 8 8 Sharebar adds a dynamic and fully customizable vertical box to the left of a blog post that contains links/buttons to popular social networking sites. … … 61 61 62 62 == Changelog == 63 = 1.4.3 = 64 * Add some output escaping. 65 63 66 = 1.4.2 = 64 67 * Add CSRF protection to admin forms. -
sharebar/trunk/sharebar-admin.php
r2745551 r2746542 21 21 } 22 22 23 $id = sanitize(isset($_REQUEST['id']) ? $_REQUEST['id'] : null);24 $pos = sanitize(isset($_REQUEST['pos']) ? $_REQUEST['pos'] : null);25 $status = sanitize(isset($_REQUEST['status']) ? $_REQUEST['status'] : null);26 $task = sanitize(isset($_REQUEST['t']) ? $_REQUEST['t'] : null);27 $do = sanitize(isset($_REQUEST['do']) ? $_REQUEST['do'] : null);23 $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null; 24 $pos = isset($_REQUEST['pos']) ? $_REQUEST['pos'] : null; 25 $status = isset($_REQUEST['status']) ? $_REQUEST['status'] : null; 26 $task = isset($_REQUEST['t']) ? $_REQUEST['t'] : null; 27 $do = isset($_REQUEST['do']) ? $_REQUEST['do'] : null; 28 28 29 29 if($id) $item = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."sharebar WHERE id=%d", $id)); … … 31 31 if($do == 'update') { 32 32 check_admin_referer( 'wp_sharebar_add_update' ); 33 $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."sharebar SET enabled='%d', position='%d', name='%s', big='%s', small='%s' WHERE id='%d'", sanitize($_POST['enabled']), sanitize($_POST['position']), $_POST['name'], $_POST['big'], $_POST['small'], $id));33 $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."sharebar SET enabled='%d', position='%d', name='%s', big='%s', small='%s' WHERE id='%d'", $_POST['enabled'], $_POST['position'], $_POST['name'], $_POST['big'], $_POST['small'], $id)); 34 34 } 35 35 elseif($do == 'add') { 36 36 check_admin_referer( 'wp_sharebar_add_update' ); 37 $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."sharebar (position, name, big, small) VALUES('%d','%s', '%s', '%s')", sanitize($_POST['position']), $_POST['name'], $_POST['big'], $_POST['small']));37 $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."sharebar (position, name, big, small) VALUES('%d','%s', '%s', '%s')", $_POST['position'], $_POST['name'], $_POST['big'], $_POST['small'])); 38 38 } 39 39 elseif($do == 'delete') { … … 59 59 foreach ($buttons as $button) 60 60 sharebar_update_button($button,$uptask); 61 $status = "Buttons have been ". $uptask."d";61 $status = "Buttons have been ".esc_html($uptask)."d"; 62 62 }else 63 63 $status = "No buttons selected."; … … 130 130 <div class="wrap"> 131 131 132 <?php if($status){?><div id="message" class="updated fade"><?php echo $status; ?></div><?php } ?>132 <?php if($status){?><div id="message" class="updated fade"><?php echo esc_html($status); ?></div><?php } ?> 133 133 134 134 <h2>Custom Sharebar</h2> … … 154 154 if(isset($item) && $item->enabled) $enabled = " checked='true'"; 155 155 ?> 156 <form action="?page=<?php echo $_GET['page']; ?>" method="post">156 <form action="?page=<?php echo esc_attr($_GET['page']); ?>" method="post"> 157 157 <?php wp_nonce_field( 'wp_sharebar_add_update' ); ?> 158 158 <p class="mediumtext alignleft"> -
sharebar/trunk/sharebar.php
r2745551 r2746542 4 4 Plugin URI: http://devgrow.com/sharebar-wordpress-plugin/ 5 5 Description: Adds a dynamic bar with sharing icons (Facebook, Twitter, etc.) that changes based on browser size and page location. 6 Version: 1.4. 26 Version: 1.4.3 7 7 Author: Monji Dolon 8 8 Author URI: http://mdolon.com/ … … 227 227 } 228 228 229 function cleanInput($input) {230 231 $search = array(232 '@<script[^>]*?>.*?</script>@si', // Strip out javascript233 '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags234 '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly235 '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments236 );237 238 $output = preg_replace($search, '', $input);239 return $output;240 }241 242 function sanitize($input) {243 if (is_array($input)) {244 foreach($input as $var=>$val) {245 $output[$var] = sanitize($val);246 }247 }248 else {249 /*250 if (get_magic_quotes_gpc()) {251 $input = stripslashes($input);252 }253 */254 $input = cleanInput($input);255 $output = esc_sql($input);256 }257 return $output;258 }259 260 261 229 add_filter('the_content', 'sharebar_auto'); 262 230 add_action('wp_enqueue_scripts', 'sharebar_scripts');
Note: See TracChangeset
for help on using the changeset viewer.