NextGEN Gallery – WordPress Gallery Plugin - Version 3.2.11

Version Description

  • 08.27.2019 = Secured: IGW queries (reported by Tin Duong of Fortinet's FortiGuard Labs)
Download this release

Release Info

Developer photocrati
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 3.2.11
Comparing to
See all releases

Code changes from version 3.2.10 to 3.2.11

changelog.txt CHANGED
@@ -1,6 +1,9 @@
1
  NextGEN Gallery
2
  by Imagely
3
 
 
 
 
4
  = V3.2.10 - 07.23.2019 =
5
  * Changed: Updated branding for Freemius opt-in
6
  * Fixed: IGW queries
1
  NextGEN Gallery
2
  by Imagely
3
 
4
+ = V3.2.11 - 08.27.2019 =
5
+ Secured: IGW queries (reported by Tin Duong of Fortinet's FortiGuard Labs)
6
+
7
  = V3.2.10 - 07.23.2019 =
8
  * Changed: Updated branding for Freemius opt-in
9
  * Fixed: IGW queries
nggallery.php CHANGED
@@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
4
  /**
5
  * Plugin Name: NextGEN Gallery
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 26 million downloads.
7
- * Version: 3.2.10
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
@@ -714,7 +714,7 @@ class C_NextGEN_Bootstrap
714
  define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
715
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
716
  define('NGG_PLUGIN_STARTED_AT', microtime());
717
- define('NGG_PLUGIN_VERSION', '3.2.10');
718
 
719
  define(
720
  'NGG_SCRIPT_VERSION',
4
  /**
5
  * Plugin Name: NextGEN Gallery
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 26 million downloads.
7
+ * Version: 3.2.11
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
714
  define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
715
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
716
  define('NGG_PLUGIN_STARTED_AT', microtime());
717
+ define('NGG_PLUGIN_VERSION', '3.2.11');
718
 
719
  define(
720
  'NGG_SCRIPT_VERSION',
products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php CHANGED
@@ -1060,6 +1060,10 @@ class C_CustomTable_DataMapper_Driver_Mixin extends Mixin
1060
  $this->object->update_columns_cache();
1061
  return $return;
1062
  }
 
 
 
 
1063
  /**
1064
  * Migrates the schema of the database
1065
  */
1060
  $this->object->update_columns_cache();
1061
  return $return;
1062
  }
1063
+ function get_column_names()
1064
+ {
1065
+ return array_keys($this->object->_columns);
1066
+ }
1067
  /**
1068
  * Migrates the schema of the database
1069
  */
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php CHANGED
@@ -23,7 +23,7 @@ class M_Gallery_Display extends C_Base_Module
23
  'photocrati-nextgen_gallery_display',
24
  'Gallery Display',
25
  'Provides the ability to display gallery of images',
26
- '3.2.10',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
23
  'photocrati-nextgen_gallery_display',
24
  'Gallery Display',
25
  'Provides the ability to display gallery of images',
26
+ '3.2.11',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php CHANGED
@@ -848,11 +848,12 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
848
  {
849
  // TODO: This method is very long, and therefore more difficult to read
850
  // Find a way to minimalize or segment
 
851
  $mapper = C_Image_Mapper::get_instance();
852
  $image_key = $mapper->get_primary_key_column();
853
  $select = $id_only ? $image_key : $mapper->get_table_name() . '.*';
854
- $sort_direction = $this->object->order_direction;
855
- $sort_by = $this->object->order_by;
856
  // Quickly sanitize
857
  global $wpdb;
858
  $this->object->container_ids = array_map(array($wpdb, '_escape'), $this->object->container_ids);
@@ -2530,33 +2531,14 @@ class Mixin_Display_Type_Form extends Mixin
2530
  }
2531
  function _render_thumbnail_override_settings_field($display_type)
2532
  {
2533
- $hidden = !(isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE);
2534
- $override_field = $this->_render_radio_field($display_type, 'override_thumbnail_settings', __('Override thumbnail settings', 'nggallery'), isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE, __("This does not affect existing thumbnails; overriding the thumbnail settings will create an additional set of thumbnails. To change the size of existing thumbnails please visit 'Manage Galleries' and choose 'Create new thumbnails' for all images in the gallery.", 'nggallery'));
2535
- $dimensions_field = $this->object->render_partial('photocrati-nextgen_gallery_display#thumbnail_settings', array('display_type_name' => $display_type->name, 'name' => 'thumbnail_dimensions', 'label' => __('Thumbnail dimensions', 'nggallery'), 'thumbnail_width' => isset($display_type->settings['thumbnail_width']) ? intval($display_type->settings['thumbnail_width']) : 0, 'thumbnail_height' => isset($display_type->settings['thumbnail_height']) ? intval($display_type->settings['thumbnail_height']) : 0, 'hidden' => $hidden ? 'hidden' : '', 'text' => ''), TRUE);
2536
- /*
2537
- $qualities = array();
2538
- for ($i = 100; $i > 40; $i -= 5) { $qualities[$i] = "{$i}%"; }
2539
- $quality_field = $this->_render_select_field(
2540
- $display_type,
2541
- 'thumbnail_quality',
2542
- __('Thumbnail quality', 'nggallery'),
2543
- $qualities,
2544
- isset($display_type->settings['thumbnail_quality']) ? $display_type->settings['thumbnail_quality'] : 100,
2545
- '',
2546
- $hidden
2547
- );
2548
- */
2549
- $crop_field = $this->_render_radio_field($display_type, 'thumbnail_crop', __('Thumbnail crop', 'nggallery'), isset($display_type->settings['thumbnail_crop']) ? $display_type->settings['thumbnail_crop'] : FALSE, '', $hidden);
2550
- /*
2551
- $watermark_field = $this->_render_radio_field(
2552
- $display_type,
2553
- 'thumbnail_watermark',
2554
- __('Thumbnail watermark', 'nggallery'),
2555
- isset($display_type->settings['thumbnail_watermark']) ? $display_type->settings['thumbnail_watermark'] : FALSE,
2556
- '',
2557
- $hidden
2558
- );
2559
- */
2560
  $everything = $override_field . $dimensions_field . $crop_field;
2561
  return $everything;
2562
  }
848
  {
849
  // TODO: This method is very long, and therefore more difficult to read
850
  // Find a way to minimalize or segment
851
+ $settings = C_NextGen_Settings::get_instance();
852
  $mapper = C_Image_Mapper::get_instance();
853
  $image_key = $mapper->get_primary_key_column();
854
  $select = $id_only ? $image_key : $mapper->get_table_name() . '.*';
855
+ $sort_direction = in_array(strtoupper($this->object->order_direction), array('ASC', 'DSC')) ? $this->object->order_direction : $settings->galSortDir;
856
+ $sort_by = in_array(strtolower($this->object->order_by), C_Image_Mapper::get_instance()->get_column_names()) ? $this->object->order_by : $settings->galSort;
857
  // Quickly sanitize
858
  global $wpdb;
859
  $this->object->container_ids = array_map(array($wpdb, '_escape'), $this->object->container_ids);
2531
  }
2532
  function _render_thumbnail_override_settings_field($display_type)
2533
  {
2534
+ $enabled = isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE;
2535
+ $hidden = !$enabled;
2536
+ $width = $enabled && isset($display_type->settings['thumbnail_width']) ? intval($display_type->settings['thumbnail_width']) : 0;
2537
+ $height = $enabled && isset($display_type->settings['thumbnail_height']) ? intval($display_type->settings['thumbnail_height']) : 0;
2538
+ $crop = $enabled && isset($display_type->settings['thumbnail_crop']) ? $display_type->settings['thumbnail_crop'] : FALSE;
2539
+ $override_field = $this->_render_radio_field($display_type, 'override_thumbnail_settings', __('Override thumbnail settings', 'nggallery'), $enabled, __("This does not affect existing thumbnails; overriding the thumbnail settings will create an additional set of thumbnails. To change the size of existing thumbnails please visit 'Manage Galleries' and choose 'Create new thumbnails' for all images in the gallery.", 'nggallery'));
2540
+ $dimensions_field = $this->object->render_partial('photocrati-nextgen_gallery_display#thumbnail_settings', array('display_type_name' => $display_type->name, 'name' => 'thumbnail_dimensions', 'label' => __('Thumbnail dimensions', 'nggallery'), 'thumbnail_width' => $width, 'thumbnail_height' => $height, 'hidden' => $hidden ? 'hidden' : '', 'text' => ''), TRUE);
2541
+ $crop_field = $this->_render_radio_field($display_type, 'thumbnail_crop', __('Thumbnail crop', 'nggallery'), $crop, '', $hidden);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2542
  $everything = $override_field . $dimensions_field . $crop_field;
2543
  return $everything;
2544
  }
products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php CHANGED
@@ -23,7 +23,7 @@ class M_NextGen_Other_Options extends C_Base_Module
23
  'photocrati-nextgen_other_options',
24
  'Other Options',
25
  'NextGEN Gallery Others Options Page',
26
- '3.1.19',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
23
  'photocrati-nextgen_other_options',
24
  'Other Options',
25
  'NextGEN Gallery Others Options Page',
26
+ '3.2.11',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php CHANGED
@@ -176,8 +176,16 @@ class A_Image_Options_Form extends Mixin
176
  $value = intval($value);
177
  break;
178
  case 'galSort':
 
 
 
 
 
179
  case 'galSortDir':
180
  $value = esc_html($value);
 
 
 
181
  break;
182
  case 'relatedHeading':
183
  $value = M_NextGen_Data::strip_html($value, TRUE);
176
  $value = intval($value);
177
  break;
178
  case 'galSort':
179
+ $value = esc_html($value);
180
+ if (!in_array(strtolower($value), array_values($this->_get_image_sorting_options()))) {
181
+ $value = 'sortorder';
182
+ }
183
+ break;
184
  case 'galSortDir':
185
  $value = esc_html($value);
186
+ if (!in_array(strtoupper($value), array('ASC', 'DSC'))) {
187
+ $value = 'ASC';
188
+ }
189
  break;
190
  case 'relatedHeading':
191
  $value = M_NextGen_Data::strip_html($value, TRUE);
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: photocrati, imagely
3
  Tags: wordpress gallery plugin, gallery, nextgen, nextgen gallery, photo gallery, image gallery, photography, slideshow, images, photo, photo album, watermark
4
  Requires at least: 4.0.0
5
- Stable tag: 3.2.10
6
  Tested up to: 5.2.2
7
  License: GPLv2
8
 
@@ -179,6 +179,9 @@ For more information, feel free to visit the official website for the NextGEN Ga
179
 
180
  == Changelog ==
181
 
 
 
 
182
  = V3.2.10 - 07.23.2019 =
183
  * Changed: Updated branding for Freemius opt-in
184
  * Fixed: IGW queries
2
  Contributors: photocrati, imagely
3
  Tags: wordpress gallery plugin, gallery, nextgen, nextgen gallery, photo gallery, image gallery, photography, slideshow, images, photo, photo album, watermark
4
  Requires at least: 4.0.0
5
+ Stable tag: 3.2.11
6
  Tested up to: 5.2.2
7
  License: GPLv2
8
 
179
 
180
  == Changelog ==
181
 
182
+ = V3.2.11 - 08.27.2019 =
183
+ Secured: IGW queries (reported by Tin Duong of Fortinet's FortiGuard Labs)
184
+
185
  = V3.2.10 - 07.23.2019 =
186
  * Changed: Updated branding for Freemius opt-in
187
  * Fixed: IGW queries