Easy Social Icons - Version 3.1.4

Version Description

  • fix/update security issue
  • check with latest wordpress version 5.9.1
  • fix security issue (Admin + SQL Injection)
Download this release

Release Info

Developer cybernetikz
Plugin Icon 128x128 Easy Social Icons
Version 3.1.4
Comparing to
See all releases

Code changes from version 3.1.3 to 3.1.4

Files changed (2) hide show
  1. easy-social-icons.php +10 -13
  2. readme.txt +7 -2
easy-social-icons.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Easy Social Icons
4
  Plugin URI: http://www.cybernetikz.com
5
  Description: You can upload your own social icon, set your social URL, choose weather you want to display vertical or horizontal. You can use the shortcode <strong>[cn-social-icon]</strong> in page/post, template tag for php file <strong>&lt;?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?&gt;</strong> also you can use the widget <strong>"Easy Social Icons"</strong> for sidebar.
6
- Version: 3.1.3
7
  Author: cybernetikz
8
  Author URI: http://www.cybernetikz.com
9
  License: GPL2
@@ -111,7 +111,7 @@ function cnss_admin_enqueue() {
111
  function cnss_get_all_icons($where_sql = '') {
112
  global $wpdb;
113
  $table_name = $wpdb->prefix . "cn_social_icon";
114
- $sql = "SELECT id, title, url, image_url, sortorder, target FROM {$table_name} WHERE url<>'' AND image_url<>'' ORDER BY sortorder;";
115
 
116
  $social_icons = $wpdb->get_results($sql);
117
  if (count($social_icons)>0) {
@@ -877,7 +877,9 @@ function cnss_social_icon_add_fn() {
877
 
878
  $table_name = $wpdb->prefix . "cn_social_icon";
879
  $image_file_path = $cnssBaseURL;
880
- $sql = sprintf("SELECT * FROM %s WHERE id=%d", $table_name, $_GET['id']);
 
 
881
  $icon_info = $wpdb->get_row($sql);
882
 
883
  if (!empty($icon_info))
@@ -1144,7 +1146,7 @@ function cnss_social_icon_table() {
1144
  global $wpdb,$cnssBaseURL;
1145
  $table_name = $wpdb->prefix . "cn_social_icon";
1146
  $image_file_path = $cnssBaseURL;
1147
- $sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' ORDER BY sortorder";
1148
  $icons = $wpdb->get_results($sql);
1149
  $icon_count = count($icons);
1150
 
@@ -1201,14 +1203,9 @@ function cn_social_icon($attr = array(), $call_from_widget = NULL) {
1201
  $attr['selected_icons'] = explode(',', $attr['selected_icons']);
1202
  }
1203
 
1204
- if(is_array($attr['selected_icons'])) {
1205
- $where_sql .= ' AND `id` IN(';
1206
- foreach($attr['selected_icons'] as $iid)
1207
- {
1208
- $where_sql .= $iid.',';
1209
- }
1210
- $where_sql = rtrim($where_sql,',');
1211
- $where_sql .= ') ';
1212
  }
1213
  }
1214
 
@@ -1227,7 +1224,7 @@ function cn_social_icon($attr = array(), $call_from_widget = NULL) {
1227
  $cnss_original_icon_color = cnss_get_option('cnss-original-icon-color');
1228
 
1229
  $table_name = $wpdb->prefix . "cn_social_icon";
1230
- $sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' $where_sql ORDER BY sortorder";
1231
  $icons = $wpdb->get_results($sql);
1232
  $icon_count = count($icons);
1233
  $li_margin = round($cnss_margin/2);
3
  Plugin Name: Easy Social Icons
4
  Plugin URI: http://www.cybernetikz.com
5
  Description: You can upload your own social icon, set your social URL, choose weather you want to display vertical or horizontal. You can use the shortcode <strong>[cn-social-icon]</strong> in page/post, template tag for php file <strong>&lt;?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?&gt;</strong> also you can use the widget <strong>"Easy Social Icons"</strong> for sidebar.
6
+ Version: 3.1.4
7
  Author: cybernetikz
8
  Author URI: http://www.cybernetikz.com
9
  License: GPL2
111
  function cnss_get_all_icons($where_sql = '') {
112
  global $wpdb;
113
  $table_name = $wpdb->prefix . "cn_social_icon";
114
+ $sql = $wpdb->prepare("SELECT `id`, `title`, `url`, `image_url`, `sortorder`, `target` FROM {$table_name} WHERE `url` != '' AND `image_url` != '' ORDER BY `sortorder`");
115
 
116
  $social_icons = $wpdb->get_results($sql);
117
  if (count($social_icons)>0) {
877
 
878
  $table_name = $wpdb->prefix . "cn_social_icon";
879
  $image_file_path = $cnssBaseURL;
880
+ $sql = $wpdb->prepare(
881
+ "SELECT * FROM `{$table_name}` WHERE `id`=%d", $_GET['id']
882
+ );
883
  $icon_info = $wpdb->get_row($sql);
884
 
885
  if (!empty($icon_info))
1146
  global $wpdb,$cnssBaseURL;
1147
  $table_name = $wpdb->prefix . "cn_social_icon";
1148
  $image_file_path = $cnssBaseURL;
1149
+ $sql = $wpdb->prepare("SELECT * FROM `{$table_name}` WHERE `image_url` != '' AND `url` != '' ORDER BY `sortorder`");
1150
  $icons = $wpdb->get_results($sql);
1151
  $icon_count = count($icons);
1152
 
1203
  $attr['selected_icons'] = explode(',', $attr['selected_icons']);
1204
  }
1205
 
1206
+ if(is_array($attr['selected_icons']) && !empty($attr['selected_icons'])) {
1207
+ $placeholder = implode(', ', array_fill(0, count($attr['selected_icons']), '%d'));
1208
+ $where_sql .= $wpdb->prepare("AND `id` IN({$placeholder})", $attr['selected_icons']);
 
 
 
 
 
1209
  }
1210
  }
1211
 
1224
  $cnss_original_icon_color = cnss_get_option('cnss-original-icon-color');
1225
 
1226
  $table_name = $wpdb->prefix . "cn_social_icon";
1227
+ $sql = $wpdb->prepare("SELECT * FROM `{$table_name}` WHERE `image_url` != '' AND `url` != '' $where_sql ORDER BY `sortorder`");
1228
  $icons = $wpdb->get_results($sql);
1229
  $icon_count = count($icons);
1230
  $li_margin = round($cnss_margin/2);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: cybernetikz
3
  Donate link:
4
  Tags: easy social icons, easy social icon, social icons, social share, follow us, custom social icons, social media icons
5
  Requires at least: 3.5
6
- Tested up to: 5.8.1
7
- Stable tag: 3.1.3
8
 
9
  Upload your own social media icons or choose from font-awesome. Use widget|shortcode to place icons anywhere(sidebar, header, footer, page) in theme.
10
 
@@ -76,6 +76,11 @@ If you are using wordpress version lower than 3.5 please use Easy social Icon ve
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
79
  = 3.1.3 =
80
  * fix/update security issue
81
 
3
  Donate link:
4
  Tags: easy social icons, easy social icon, social icons, social share, follow us, custom social icons, social media icons
5
  Requires at least: 3.5
6
+ Tested up to: 5.9.1
7
+ Stable tag: 3.1.4
8
 
9
  Upload your own social media icons or choose from font-awesome. Use widget|shortcode to place icons anywhere(sidebar, header, footer, page) in theme.
10
 
76
 
77
  == Changelog ==
78
 
79
+ = 3.1.4 =
80
+ * fix/update security issue
81
+ * check with latest wordpress version 5.9.1
82
+ * fix security issue (Admin + SQL Injection)
83
+
84
  = 3.1.3 =
85
  * fix/update security issue
86