NextGEN Gallery – WordPress Gallery Plugin - Version 2.0.77.3

Version Description

  • 03.12.2015 =
  • Secured: Upload images and importing galleries from folders
  • Fixed: When importing galleries from folders, allow symlinks
  • Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
  • Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
  • Fixed: Warning about missing style.php file on Network Admin -> Gallery page
Download this release

Release Info

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

Code changes from version 2.0.77 to 2.0.77.3

.hg_archival.txt CHANGED
@@ -1,4 +1,4 @@
1
  repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb
2
- node: bfedd0b35f2026e255c69d07edfa75228261aeb1
3
- branch: default
4
- tag: 2.0.77
1
  repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb
2
+ node: 2ed5f4d1c1b86dc355dbec73ee023858d16f5932
3
+ branch: 2.0.77.3
4
+ tag: 2.0.77.3
changelog.txt CHANGED
@@ -1,6 +1,13 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
 
 
 
 
 
 
 
4
  = V2.0.77 - 03.05.2015 =
5
  * NEW: Added "ngg_get_image_url" filter
6
  * Changed: Use a more reliable means of excluding Pro/Plus modules from using minified static resources
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
+ = V2.0.77.3 - 03.12.2015 =
5
+ * Secured: Upload images and importing galleries from folders
6
+ * Fixed: When importing galleries from folders, allow symlinks
7
+ * Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
8
+ * Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
9
+ * Fixed: Warning about missing style.php file on Network Admin -> Gallery page
10
+
11
  = V2.0.77 - 03.05.2015 =
12
  * NEW: Added "ngg_get_image_url" filter
13
  * Changed: Use a more reliable means of excluding Pro/Plus modules from using minified static resources
nggallery.php CHANGED
@@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
4
  /**
5
  * Plugin Name: NextGEN Gallery by Photocrati
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 12 million downloads.
7
- * Version: 2.0.77
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
@@ -584,7 +584,7 @@ class C_NextGEN_Bootstrap
584
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
585
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
586
  define('NGG_PLUGIN_STARTED_AT', microtime());
587
- define('NGG_PLUGIN_VERSION', '2.0.77');
588
 
589
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
590
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
4
  /**
5
  * Plugin Name: NextGEN Gallery by Photocrati
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 12 million downloads.
7
+ * Version: 2.0.77.3
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
584
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
585
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
586
  define('NGG_PLUGIN_STARTED_AT', microtime());
587
+ define('NGG_PLUGIN_VERSION', '2.0.77.3');
588
 
589
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
590
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
non_pope/class.photocrati_resource_manager.php CHANGED
@@ -4,7 +4,7 @@ class C_Photocrati_Resource_Manager
4
  {
5
  static $instance = NULL;
6
 
7
- public $marker = '<!-- ngg_resource_manager_marker -->';
8
 
9
  var $buffer = '';
10
  var $styles = '';
@@ -24,18 +24,18 @@ class C_Photocrati_Resource_Manager
24
  // Validate the request
25
  $this->validate_request();
26
  add_action('init', array(&$this, 'start_buffer'), -1);
27
- add_action('wp_footer', array(&$this, 'print_marker'), -1);
28
  }
29
 
30
- /**
31
- * Created early as possible in the wp_footer action this is the string to which we
32
- * will move JS resources after
33
- */
34
- function print_marker()
35
- {
36
- // is_feed() is important to not break Wordpress feeds and the WooCommerce api
37
- if ($this->valid_request && !is_feed()) print $this->marker;
38
- }
39
 
40
  /**
41
  * Determines if the resource manager should perform it's routines for this request
@@ -46,38 +46,38 @@ class C_Photocrati_Resource_Manager
46
  $this->valid_request = $this->is_valid_request();
47
  }
48
 
49
- function is_valid_request()
50
- {
51
- $retval = TRUE;
52
-
53
- if (is_admin()) {
54
- if (isset($_REQUEST['page']) && !preg_match("#^(ngg|nextgen)#", $_REQUEST['page'])) $retval = FALSE;
55
- }
56
-
57
- if (preg_match("#wp-admin/update|wp-login|wp-signup#", $_SERVER['REQUEST_URI'])) $retval = FALSE;
58
- else if (isset($_GET['display_gallery_iframe'])) $retval = FALSE;
59
- else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE;
60
- else if (preg_match("/(js|css|xsl|xml|kml)$/", $_SERVER['REQUEST_URI'])) $retval = FALSE;
61
- else if (preg_match("#/feed(/?)$#i", $_SERVER['REQUEST_URI']) || !empty($_GET['feed'])) $retval = FALSE;
62
- elseif (preg_match("/\\.(\\w{3,4})$/", $_SERVER['REQUEST_URI'], $match)) {
63
- if (!in_array($match[1], array('htm', 'html', 'php'))) {
64
- $retval = FALSE;
65
- }
66
- }
67
- elseif ((isset($_SERVER['PATH_INFO']) && strpos($_SERVER['PATH_INFO'], 'nextgen-pro-lightbox-gallery') !== FALSE) OR strpos($_SERVER['REQUEST_URI'], 'nextgen-pro-lightbox-gallery') !== FALSE) {
68
- $retval = FALSE;
69
- }
70
-
71
- return $retval;
72
- }
73
 
74
  /**
75
  * Start the output buffers
76
  */
77
  function start_buffer()
78
  {
79
- if (defined('NGG_DISABLE_RESOURCE_MANAGER') && NGG_DISABLE_RESOURCE_MANAGER)
80
- return;
81
 
82
  if (apply_filters('run_ngg_resource_manager', $this->valid_request)) {
83
  ob_start(array(&$this, 'output_buffer_handler'));
@@ -142,14 +142,14 @@ class C_Photocrati_Resource_Manager
142
  $this->buffer = str_ireplace('</head>', $this->styles.'</head>', $this->buffer);
143
  }
144
 
145
- // Move the scripts to the bottom of the page
146
- if ($this->scripts) {
147
- $this->buffer = str_ireplace($this->marker, $this->marker . $this->scripts, $this->buffer);
148
- }
149
 
150
- if ($this->other_output) {
151
- $this->buffer = str_replace($this->marker, $this->marker . $this->other_output, $this->buffer);
152
- }
153
  }
154
  }
155
 
@@ -191,6 +191,7 @@ class C_Photocrati_Resource_Manager
191
  wp_print_footer_scripts();
192
  }
193
  $this->other_output = ob_get_clean();
 
194
  }
195
  }
196
 
4
  {
5
  static $instance = NULL;
6
 
7
+ public $marker = '<!-- ngg_resource_manager_marker -->';
8
 
9
  var $buffer = '';
10
  var $styles = '';
24
  // Validate the request
25
  $this->validate_request();
26
  add_action('init', array(&$this, 'start_buffer'), -1);
27
+ add_action('wp_footer', array(&$this, 'print_marker'), -1);
28
  }
29
 
30
+ /**
31
+ * Created early as possible in the wp_footer action this is the string to which we
32
+ * will move JS resources after
33
+ */
34
+ function print_marker()
35
+ {
36
+ // is_feed() is important to not break Wordpress feeds and the WooCommerce api
37
+ if ($this->valid_request && !is_feed()) print $this->marker;
38
+ }
39
 
40
  /**
41
  * Determines if the resource manager should perform it's routines for this request
46
  $this->valid_request = $this->is_valid_request();
47
  }
48
 
49
+ function is_valid_request()
50
+ {
51
+ $retval = TRUE;
52
+
53
+ if (is_admin()) {
54
+ if (isset($_REQUEST['page']) && !preg_match("#^(ngg|nextgen)#", $_REQUEST['page'])) $retval = FALSE;
55
+ }
56
+
57
+ if (preg_match("#wp-admin/update|wp-login|wp-signup#", $_SERVER['REQUEST_URI'])) $retval = FALSE;
58
+ else if (isset($_GET['display_gallery_iframe'])) $retval = FALSE;
59
+ else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE;
60
+ else if (preg_match("/(js|css|xsl|xml|kml)$/", $_SERVER['REQUEST_URI'])) $retval = FALSE;
61
+ else if (preg_match("#/feed(/?)$#i", $_SERVER['REQUEST_URI']) || !empty($_GET['feed'])) $retval = FALSE;
62
+ elseif (preg_match("/\\.(\\w{3,4})$/", $_SERVER['REQUEST_URI'], $match)) {
63
+ if (!in_array($match[1], array('htm', 'html', 'php'))) {
64
+ $retval = FALSE;
65
+ }
66
+ }
67
+ elseif ((isset($_SERVER['PATH_INFO']) && strpos($_SERVER['PATH_INFO'], 'nextgen-pro-lightbox-gallery') !== FALSE) OR strpos($_SERVER['REQUEST_URI'], 'nextgen-pro-lightbox-gallery') !== FALSE) {
68
+ $retval = FALSE;
69
+ }
70
+
71
+ return $retval;
72
+ }
73
 
74
  /**
75
  * Start the output buffers
76
  */
77
  function start_buffer()
78
  {
79
+ if (defined('NGG_DISABLE_RESOURCE_MANAGER') && NGG_DISABLE_RESOURCE_MANAGER)
80
+ return;
81
 
82
  if (apply_filters('run_ngg_resource_manager', $this->valid_request)) {
83
  ob_start(array(&$this, 'output_buffer_handler'));
142
  $this->buffer = str_ireplace('</head>', $this->styles.'</head>', $this->buffer);
143
  }
144
 
145
+ // Move the scripts to the bottom of the page
146
+ if ($this->scripts) {
147
+ $this->buffer = str_ireplace($this->marker, $this->marker . $this->scripts, $this->buffer);
148
+ }
149
 
150
+ if ($this->other_output) {
151
+ $this->buffer = str_replace($this->marker, $this->marker . $this->other_output, $this->buffer);
152
+ }
153
  }
154
  }
155
 
191
  wp_print_footer_scripts();
192
  }
193
  $this->other_output = ob_get_clean();
194
+ $this->buffer = str_ireplace('</body>', $this->marker.'</body>', $this->buffer);
195
  }
196
  }
197
 
products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php CHANGED
@@ -14,7 +14,7 @@ class A_Import_Folder_Form extends Mixin
14
  }
15
  public function render()
16
  {
17
- return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_folder', array(), TRUE);
18
  }
19
  }
20
  class A_NextGen_AddGallery_Ajax extends Mixin
@@ -36,7 +36,7 @@ class A_NextGen_AddGallery_Ajax extends Mixin
36
  $gallery_name = urldecode($this->param('gallery_name'));
37
  $gallery_mapper = C_Gallery_Mapper::get_instance();
38
  $error = FALSE;
39
- if ($this->validate_ajax_request('nextgen_upload_image')) {
40
  // We need to create a gallery
41
  if ($gallery_id == 0) {
42
  if (strlen($gallery_name) > 0) {
@@ -107,13 +107,12 @@ class A_NextGen_AddGallery_Ajax extends Mixin
107
  {
108
  $retval = array();
109
  $html = array();
110
- if ($this->validate_ajax_request('nextgen_upload_image')) {
111
  if ($dir = urldecode($this->param('dir'))) {
112
  $fs = C_Fs::get_instance();
113
  $root = $this->get_import_root_abspath();
114
- $browse_path = $fs->join_paths($root, $dir);
115
- $import_path = @realpath($browse_path);
116
- if (strpos($import_path, $root) === 0) {
117
  if (@file_exists($browse_path)) {
118
  $files = scandir($browse_path);
119
  natcasesort($files);
@@ -148,16 +147,15 @@ class A_NextGen_AddGallery_Ajax extends Mixin
148
  public function import_folder_action()
149
  {
150
  $retval = array();
151
- if ($this->validate_ajax_request('nextgen_upload_image')) {
152
  if ($folder = $this->param('folder')) {
153
  $storage = C_Gallery_Storage::get_instance();
154
  $fs = C_Fs::get_instance();
155
  try {
156
  $keep_files = $this->param('keep_location') == 'on';
157
  $root = $this->get_import_root_abspath();
158
- $import_path = $fs->join_paths($root, $folder);
159
- $import_path = @realpath($import_path);
160
- if (strpos($import_path, $root) === 0) {
161
  $retval = $storage->import_gallery_from_fs($import_path, FALSE, !$keep_files);
162
  if (!$retval) {
163
  $retval = array('error' => 'Could not import folder. No images found.');
@@ -254,7 +252,7 @@ class A_Upload_Images_Form extends Mixin
254
  }
255
  public function render()
256
  {
257
- return $this->object->render_partial('photocrati-nextgen_addgallery_page#upload_images', array('plupload_options' => json_encode($this->object->get_plupload_options()), 'galleries' => $this->object->get_galleries()), TRUE);
258
  }
259
  public function get_plupload_options()
260
  {
14
  }
15
  public function render()
16
  {
17
+ return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_folder', array('browse_sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image'), 'import_sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')), TRUE);
18
  }
19
  }
20
  class A_NextGen_AddGallery_Ajax extends Mixin
36
  $gallery_name = urldecode($this->param('gallery_name'));
37
  $gallery_mapper = C_Gallery_Mapper::get_instance();
38
  $error = FALSE;
39
+ if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) {
40
  // We need to create a gallery
41
  if ($gallery_id == 0) {
42
  if (strlen($gallery_name) > 0) {
107
  {
108
  $retval = array();
109
  $html = array();
110
+ if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) {
111
  if ($dir = urldecode($this->param('dir'))) {
112
  $fs = C_Fs::get_instance();
113
  $root = $this->get_import_root_abspath();
114
+ if ($dir != '.' && $dir != '..') {
115
+ $browse_path = $fs->join_paths($root, $dir);
 
116
  if (@file_exists($browse_path)) {
117
  $files = scandir($browse_path);
118
  natcasesort($files);
147
  public function import_folder_action()
148
  {
149
  $retval = array();
150
+ if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) {
151
  if ($folder = $this->param('folder')) {
152
  $storage = C_Gallery_Storage::get_instance();
153
  $fs = C_Fs::get_instance();
154
  try {
155
  $keep_files = $this->param('keep_location') == 'on';
156
  $root = $this->get_import_root_abspath();
157
+ if ($folder != '.' && $folder != '..') {
158
+ $import_path = $fs->join_paths($root, $folder);
 
159
  $retval = $storage->import_gallery_from_fs($import_path, FALSE, !$keep_files);
160
  if (!$retval) {
161
  $retval = array('error' => 'Could not import folder. No images found.');
252
  }
253
  public function render()
254
  {
255
+ return $this->object->render_partial('photocrati-nextgen_addgallery_page#upload_images', array('plupload_options' => json_encode($this->object->get_plupload_options()), 'galleries' => $this->object->get_galleries(), 'sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')), TRUE);
256
  }
257
  public function get_plupload_options()
258
  {
products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php CHANGED
@@ -13,11 +13,15 @@
13
  $(window).data('ready', true);
14
  else return;
15
 
 
 
 
 
16
  // Render file browser
17
  $('#file_browser').fileTree({
18
  root: '/',
19
  script: photocrati_ajax.url,
20
- post_params: {action: 'browse_folder', token: ''}
21
  }, function(file){
22
  selected_folder = file;
23
  $('#file_browser a').each(function(){
@@ -42,11 +46,11 @@
42
  });
43
 
44
  // Start importing process
45
- var post_params = {
46
- action: 'import_folder',
47
- folder: selected_folder,
48
- keep_location: $('#import_keep_location').is(":checked") ? 'on' : 'off'
49
- };
50
  $.post(photocrati_ajax.url, post_params, function(response){
51
  if (typeof(response) != 'object') response = JSON.parse(response);
52
  if (typeof(response.error) == 'string') {
13
  $(window).data('ready', true);
14
  else return;
15
 
16
+ // Post params
17
+ var browse_params = <?php echo $browse_sec_token->get_json() ?>;
18
+ browse_params.action = 'browse_folder';
19
+
20
  // Render file browser
21
  $('#file_browser').fileTree({
22
  root: '/',
23
  script: photocrati_ajax.url,
24
+ post_params: browse_params
25
  }, function(file){
26
  selected_folder = file;
27
  $('#file_browser a').each(function(){
46
  });
47
 
48
  // Start importing process
49
+ var post_params = <?php echo $import_sec_token->get_json()?>;
50
+ post_params.action = 'import_folder';
51
+ post_params.folder = selected_folder;
52
+ post_params.keep_location = $('#import_keep_location').is(":checked") ? 'on' : 'off';
53
+
54
  $.post(photocrati_ajax.url, post_params, function(response){
55
  if (typeof(response) != 'object') response = JSON.parse(response);
56
  if (typeof(response.error) == 'string') {
products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php CHANGED
@@ -45,6 +45,9 @@
45
  window.set_plupload_url = function(gallery_id, gallery_name) {
46
  var qs = "&action=upload_image&gallery_id="+urlencode(gallery_id);
47
  qs += "&gallery_name="+urlencode(gallery_name);
 
 
 
48
  return photocrati_ajax.url + qs;
49
  };
50
 
45
  window.set_plupload_url = function(gallery_id, gallery_name) {
46
  var qs = "&action=upload_image&gallery_id="+urlencode(gallery_id);
47
  qs += "&gallery_name="+urlencode(gallery_name);
48
+ <?php foreach ($sec_token->get_request_list() as $name=>$value): ?>
49
+ qs += "&<?php echo $name?>=<?php echo $value?>";
50
+ <?php endforeach ?>
51
  return photocrati_ajax.url + qs;
52
  };
53
 
products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php CHANGED
@@ -2051,12 +2051,7 @@ class C_Image_Wrapper
2051
  $this->_cache['alttext'] = empty($this->_cache['alttext']) ? ' ' : html_entity_decode(stripslashes($this->_cache['alttext']));
2052
  return $this->_cache['alttext'];
2053
  case 'author':
2054
- if ($this->_legacy) {
2055
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2056
- } else {
2057
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2058
- $gallery = $gallery_map->find($this->__get('galleryid'));
2059
- }
2060
  $this->_cache['author'] = $gallery->name;
2061
  return $this->_cache['author'];
2062
  case 'caption':
@@ -2070,21 +2065,11 @@ class C_Image_Wrapper
2070
  $this->_cache['description'] = empty($this->_cache['description']) ? ' ' : html_entity_decode(stripslashes($this->_cache['description']));
2071
  return $this->_cache['description'];
2072
  case 'galdesc':
2073
- if ($this->_legacy) {
2074
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2075
- } else {
2076
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2077
- $gallery = $gallery_map->find($this->__get('galleryid'));
2078
- }
2079
  $this->_cache['galdesc'] = $gallery->name;
2080
  return $this->_cache['galdesc'];
2081
  case 'gid':
2082
- if ($this->_legacy) {
2083
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2084
- } else {
2085
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2086
- $gallery = $gallery_map->find($this->__get('galleryid'));
2087
- }
2088
  $this->_cache['gid'] = $gallery->{$gallery->id_field};
2089
  return $this->_cache['gid'];
2090
  case 'href':
@@ -2108,30 +2093,15 @@ class C_Image_Wrapper
2108
  $this->_cache['linktitle'] = htmlspecialchars(stripslashes($this->__get('description')));
2109
  return $this->_cache['linktitle'];
2110
  case 'name':
2111
- if ($this->_legacy) {
2112
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2113
- } else {
2114
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2115
- $gallery = $gallery_map->find($this->__get('galleryid'));
2116
- }
2117
  $this->_cache['name'] = $gallery->name;
2118
  return $this->_cache['name'];
2119
  case 'pageid':
2120
- if ($this->_legacy) {
2121
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2122
- } else {
2123
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2124
- $gallery = $gallery_map->find($this->__get('galleryid'));
2125
- }
2126
  $this->_cache['pageid'] = $gallery->name;
2127
  return $this->_cache['pageid'];
2128
  case 'path':
2129
- if ($this->_legacy) {
2130
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2131
- } else {
2132
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2133
- $gallery = $gallery_map->find($this->__get('galleryid'));
2134
- }
2135
  $this->_cache['path'] = $gallery->name;
2136
  return $this->_cache['path'];
2137
  case 'permalink':
@@ -2148,12 +2118,7 @@ class C_Image_Wrapper
2148
  $this->_cache['pidlink'] = $controller->set_param_for($application->get_routed_url(TRUE), 'pid', $this->__get('image_slug'));
2149
  return $this->_cache['pidlink'];
2150
  case 'previewpic':
2151
- if ($this->_legacy) {
2152
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2153
- } else {
2154
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2155
- $gallery = $gallery_map->find($this->__get('galleryid'));
2156
- }
2157
  $this->_cache['previewpic'] = $gallery->name;
2158
  return $this->_cache['previewpic'];
2159
  case 'size':
@@ -2179,12 +2144,7 @@ class C_Image_Wrapper
2179
  }
2180
  return "width='{$w}' height='{$h}'";
2181
  case 'slug':
2182
- if ($this->_legacy) {
2183
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2184
- } else {
2185
- $gallery_map = $this->get_gallery($this->__get('galleryid'));
2186
- $gallery = $gallery_map->find($this->__get('galleryid'));
2187
- }
2188
  $this->_cache['slug'] = $gallery->name;
2189
  return $this->_cache['slug'];
2190
  case 'tags':
@@ -2282,8 +2242,7 @@ class C_Image_Wrapper
2282
  if (isset($this->container) && method_exists($this->container, 'get_gallery')) {
2283
  return $this->container->get_gallery($gallery_id);
2284
  }
2285
- $gallery_map = C_Gallery_Mapper::get_instance();
2286
- return $gallery_map->find($gallery_id);
2287
  }
2288
  /**
2289
  * Retrieves I_Gallery_Mapper instance.
2051
  $this->_cache['alttext'] = empty($this->_cache['alttext']) ? ' ' : html_entity_decode(stripslashes($this->_cache['alttext']));
2052
  return $this->_cache['alttext'];
2053
  case 'author':
2054
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2055
  $this->_cache['author'] = $gallery->name;
2056
  return $this->_cache['author'];
2057
  case 'caption':
2065
  $this->_cache['description'] = empty($this->_cache['description']) ? ' ' : html_entity_decode(stripslashes($this->_cache['description']));
2066
  return $this->_cache['description'];
2067
  case 'galdesc':
2068
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2069
  $this->_cache['galdesc'] = $gallery->name;
2070
  return $this->_cache['galdesc'];
2071
  case 'gid':
2072
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2073
  $this->_cache['gid'] = $gallery->{$gallery->id_field};
2074
  return $this->_cache['gid'];
2075
  case 'href':
2093
  $this->_cache['linktitle'] = htmlspecialchars(stripslashes($this->__get('description')));
2094
  return $this->_cache['linktitle'];
2095
  case 'name':
2096
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2097
  $this->_cache['name'] = $gallery->name;
2098
  return $this->_cache['name'];
2099
  case 'pageid':
2100
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2101
  $this->_cache['pageid'] = $gallery->name;
2102
  return $this->_cache['pageid'];
2103
  case 'path':
2104
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2105
  $this->_cache['path'] = $gallery->name;
2106
  return $this->_cache['path'];
2107
  case 'permalink':
2118
  $this->_cache['pidlink'] = $controller->set_param_for($application->get_routed_url(TRUE), 'pid', $this->__get('image_slug'));
2119
  return $this->_cache['pidlink'];
2120
  case 'previewpic':
2121
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2122
  $this->_cache['previewpic'] = $gallery->name;
2123
  return $this->_cache['previewpic'];
2124
  case 'size':
2144
  }
2145
  return "width='{$w}' height='{$h}'";
2146
  case 'slug':
2147
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
 
 
 
 
 
2148
  $this->_cache['slug'] = $gallery->name;
2149
  return $this->_cache['slug'];
2150
  case 'tags':
2242
  if (isset($this->container) && method_exists($this->container, 'get_gallery')) {
2243
  return $this->container->get_gallery($gallery_id);
2244
  }
2245
+ return C_Gallery_Mapper::get_instance()->find($gallery_id);
 
2246
  }
2247
  /**
2248
  * Retrieves I_Gallery_Mapper instance.
products/photocrati_nextgen/modules/ngglegacy/admin/admin.php CHANGED
@@ -196,7 +196,6 @@ class nggAdminPanel{
196
 
197
  // show the network page
198
  function show_network_settings() {
199
- include_once ( dirname (__FILE__) . '/style.php' );
200
  include_once ( dirname (__FILE__) . '/wpmu.php' );
201
  nggallery_wpmu_setup();
202
  }
196
 
197
  // show the network page
198
  function show_network_settings() {
 
199
  include_once ( dirname (__FILE__) . '/wpmu.php' );
200
  nggallery_wpmu_setup();
201
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: photocrati
3
  Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer
4
  Requires at least: 3.6.1
5
  Tested up to: 4.1.1
6
- Stable tag: 2.0.77
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 12 million downloads.
@@ -199,6 +199,13 @@ For more information, feel free to visit the official website for the NextGEN Ga
199
 
200
  == Changelog ==
201
 
 
 
 
 
 
 
 
202
  = V2.0.77 - 03.05.2015 =
203
  * NEW: Added "ngg_get_image_url" filter
204
  * Changed: Use a more reliable means of excluding Pro/Plus modules from using minified static resources
3
  Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer
4
  Requires at least: 3.6.1
5
  Tested up to: 4.1.1
6
+ Stable tag: 2.0.77.3
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 12 million downloads.
199
 
200
  == Changelog ==
201
 
202
+ = V2.0.77.3 - 03.12.2015 =
203
+ * Secured: Upload images and importing galleries from folders
204
+ * Fixed: When importing galleries from folders, allow symlinks
205
+ * Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
206
+ * Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
207
+ * Fixed: Warning about missing style.php file on Network Admin -> Gallery page
208
+
209
  = V2.0.77 - 03.05.2015 =
210
  * NEW: Added "ngg_get_image_url" filter
211
  * Changed: Use a more reliable means of excluding Pro/Plus modules from using minified static resources