Changeset 3447757
- Timestamp:
- 01/27/2026 10:43:46 AM (2 months ago)
- Location:
- modula-best-grid-gallery
- Files:
-
- 14 edited
- 1 copied
-
tags/2.13.7 (copied) (copied from modula-best-grid-gallery/trunk)
-
tags/2.13.7/Modula.php (modified) (2 diffs)
-
tags/2.13.7/assets/js/admin/editor-plugin.js (modified) (1 diff)
-
tags/2.13.7/assets/js/admin/editor-plugin.min.js (modified) (1 diff)
-
tags/2.13.7/changelog.txt (modified) (1 diff)
-
tags/2.13.7/includes/admin/class-modula-cpt.php (modified) (4 diffs)
-
tags/2.13.7/includes/class-modula.php (modified) (2 diffs)
-
tags/2.13.7/readme.txt (modified) (2 diffs)
-
trunk/Modula.php (modified) (2 diffs)
-
trunk/assets/js/admin/editor-plugin.js (modified) (1 diff)
-
trunk/assets/js/admin/editor-plugin.min.js (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/includes/admin/class-modula-cpt.php (modified) (4 diffs)
-
trunk/includes/class-modula.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modula-best-grid-gallery/tags/2.13.7/Modula.php
r3443192 r3447757 5 5 * Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks. 6 6 * Author: WPChill 7 * Version: 2.13. 67 * Version: 2.13.7 8 8 * Author URI: https://www.wpchill.com/ 9 9 * License: GPLv3 or later … … 48 48 */ 49 49 50 define( 'MODULA_LITE_VERSION', '2.13. 6' );50 define( 'MODULA_LITE_VERSION', '2.13.7' ); 51 51 define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) ); 52 52 define( 'MODULA_URL', plugin_dir_url( __FILE__ ) ); -
modula-best-grid-gallery/tags/2.13.7/assets/js/admin/editor-plugin.js
r3262199 r3447757 1 1 (function () { 2 tinymce.create('tinymce.plugins.Modula', {2 tinymce.create('tinymce.plugins.Modula', { 3 3 init: function (ed, url) { 4 4 ed.addCommand('modula_shortcode_editor', function () { 5 var nonce = typeof modulaEditorNonce !== 'undefined' ? modulaEditorNonce : ''; 6 var ajaxUrl = ajaxurl + '?action=modula_shortcode_editor'; 7 if (nonce) { 8 ajaxUrl += '&nonce=' + encodeURIComponent(nonce); 9 } 5 10 ed.windowManager.open( 6 11 { 7 file: ajax url + '?action=modula_shortcode_editor',12 file: ajaxUrl, 8 13 width: 9 14 900 + parseInt(ed.getLang('button.delta_width', 0)), -
modula-best-grid-gallery/tags/2.13.7/assets/js/admin/editor-plugin.min.js
r2982490 r3447757 1 tinymce.create("tinymce.plugins.Modula",{init:function( t,o){t.addCommand("modula_shortcode_editor",(function(){t.windowManager.open({file:ajaxurl+"?action=modula_shortcode_editor",width:900+parseInt(t.getLang("button.delta_width",0)),height:500+parseInt(t.getLang("button.delta_height",0)),inline:1},{plugin_url:o})}));var e=o.split("assets/");t.addButton("modula_shortcode_editor",{title:"Modula Gallery",cmd:"modula_shortcode_editor",image:e[0]+"assets/images/modula-logo.jpg"})},getInfo:function(){return{longname:"Modula Gallery",author:"Macho Themes",authorurl:"https://www.machothemes.com/",infourl:"https://www.machothemes.com/",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("modula_shortcode_editor",tinymce.plugins.Modula);1 tinymce.create("tinymce.plugins.Modula",{init:function(o,e){o.addCommand("modula_shortcode_editor",(function(){var t="undefined"!=typeof modulaEditorNonce?modulaEditorNonce:"",n=ajaxurl+"?action=modula_shortcode_editor";t&&(n+="&nonce="+encodeURIComponent(t)),o.windowManager.open({file:n,width:900+parseInt(o.getLang("button.delta_width",0)),height:500+parseInt(o.getLang("button.delta_height",0)),inline:1},{plugin_url:e})}));var t=e.split("assets/");o.addButton("modula_shortcode_editor",{title:"Modula Gallery",cmd:"modula_shortcode_editor",image:t[0]+"assets/images/modula-logo.jpg"})},getInfo:function(){return{longname:"Modula Gallery",author:"Macho Themes",authorurl:"https://www.machothemes.com/",infourl:"https://www.machothemes.com/",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("modula_shortcode_editor",tinymce.plugins.Modula); -
modula-best-grid-gallery/tags/2.13.7/changelog.txt
r3443192 r3447757 1 = 2.13.7 - 27.01.2026 = 2 Fixed: Security issues. 3 1 4 = 2.13.6 - 20.01.2026 = 2 5 Fixed: Gutenberg block editor was throwing an error due to circular references. -
modula-best-grid-gallery/tags/2.13.7/includes/admin/class-modula-cpt.php
r3352565 r3447757 225 225 $modula_images = $this->sanitize_images( $value ); 226 226 227 $this->batch_update_images( $modula_images, $obj->ID ); 228 227 // Validate and filter out invalid attachment IDs before processing 228 $valid_images = array(); 229 foreach ( $modula_images as $image ) { 230 if ( ! isset( $image['id'] ) || empty( $image['id'] ) ) { 231 continue; 232 } 233 234 $attachment_id = absint( $image['id'] ); 235 if ( ! $attachment_id ) { 236 continue; 237 } 238 239 // Security check: Verify the ID is an attachment 240 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 241 continue; 242 } 243 244 // Security check: Verify user has permission to edit this attachment 245 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 246 continue; 247 } 248 249 $valid_images[] = $image; 250 } 251 252 // Only update with valid attachments 253 $this->batch_update_images( $valid_images, $obj->ID ); 254 255 // Update gallery meta with filtered valid images 229 256 update_post_meta( 230 257 $obj->ID, 231 258 'modula-images', 232 $ modula_images259 $valid_images 233 260 ); 234 261 } … … 253 280 254 281 // We’ll process in chunks to avoid overly large queries 282 // Additional security: Filter out any invalid attachments that may have slipped through 283 $valid_images = array(); 284 foreach ( $images as $image ) { 285 if ( ! isset( $image['id'] ) || empty( $image['id'] ) ) { 286 continue; 287 } 288 289 $attachment_id = absint( $image['id'] ); 290 if ( ! $attachment_id ) { 291 continue; 292 } 293 294 // Security check: Verify the ID is an attachment 295 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 296 continue; 297 } 298 299 // Security check: Verify user has permission to edit this attachment 300 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 301 continue; 302 } 303 304 $valid_images[] = $image; 305 } 306 307 if ( empty( $valid_images ) ) { 308 return; 309 } 310 255 311 $batch_size = 200; 256 $chunks = array_chunk( $ images, $batch_size );312 $chunks = array_chunk( $valid_images, $batch_size ); 257 313 258 314 foreach ( $chunks as $chunk ) { … … 267 323 global $wpdb; 268 324 269 // 1) Collect a ll relevant attachment IDs325 // 1) Collect and validate all relevant attachment IDs 270 326 $attachment_ids = array(); 327 $valid_images = array(); 328 271 329 foreach ( $images_chunk as $image ) { 272 if ( ! empty( $image['id'] ) ) { 273 $attachment_ids[] = absint( $image['id'] ); 274 } 275 } 276 $attachment_ids = array_filter( $attachment_ids ); 330 if ( ! isset( $image['id'] ) || empty( $image['id'] ) ) { 331 continue; 332 } 333 334 $attachment_id = absint( $image['id'] ); 335 if ( ! $attachment_id ) { 336 continue; 337 } 338 339 // Security check: Verify the ID is an attachment 340 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 341 continue; 342 } 343 344 // Security check: Verify user has permission to edit this attachment 345 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 346 continue; 347 } 348 349 $attachment_ids[] = $attachment_id; 350 $valid_images[] = $image; 351 } 352 277 353 $attachment_ids = array_unique( $attachment_ids ); 278 354 … … 323 399 $meta_inserts = array(); // We'll insert the new alt rows 324 400 325 // 4) Loop through images and build the final updates only if needed326 foreach ( $ images_chunkas $image ) {401 // 4) Loop through valid images and build the final updates only if needed 402 foreach ( $valid_images as $image ) { 327 403 $attachment_id = isset( $image['id'] ) ? absint( $image['id'] ) : 0; 328 404 if ( ! $attachment_id ) { 405 continue; 406 } 407 408 // Additional security check: Verify the ID is still an attachment (defense in depth) 409 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 410 continue; 411 } 412 413 // Additional security check: Verify user still has permission (defense in depth) 414 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 329 415 continue; 330 416 } -
modula-best-grid-gallery/tags/2.13.7/includes/class-modula.php
r3394968 r3447757 168 168 add_filter( 'mce_external_plugins', array( $this, 'register_editor_plugin' ) ); 169 169 add_action( 'wp_ajax_modula_shortcode_editor', array( $this, 'modula_shortcode_editor' ) ); 170 add_action( 'admin_print_scripts', array( $this, 'add_editor_nonce' ) ); 170 171 171 172 // Allow other mime types to be uploaded … … 543 544 544 545 /** 546 * Add nonce for TinyMCE editor plugin 547 */ 548 public function add_editor_nonce() { 549 $screen = get_current_screen(); 550 // Only add nonce on post edit screens where TinyMCE is available 551 if ( ! $screen || ! in_array( $screen->base, array( 'post', 'page' ), true ) ) { 552 return; 553 } 554 ?> 555 <script type="text/javascript"> 556 var modulaEditorNonce = '<?php echo esc_js( wp_create_nonce( 'modula-ajax-save' ) ); ?>'; 557 </script> 558 <?php 559 } 560 561 /** 545 562 * Display galleries selection 546 563 */ 547 564 public function modula_shortcode_editor() { 565 // Check user capability 566 if ( ! current_user_can( 'edit_posts' ) ) { 567 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'modula-best-grid-gallery' ) ); 568 } 569 570 // Verify nonce 571 $nonce = ''; 572 if ( isset( $_REQUEST['nonce'] ) ) { 573 $nonce = sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ); 574 } 575 576 if ( ! wp_verify_nonce( $nonce, 'modula-ajax-save' ) ) { 577 wp_die( esc_html__( 'Security check failed.', 'modula-best-grid-gallery' ) ); 578 } 579 548 580 $css_path = MODULA_URL . 'assets/css/admin/edit.css'; 549 581 $admin_url = admin_url(); -
modula-best-grid-gallery/tags/2.13.7/readme.txt
r3443192 r3447757 5 5 Tested up to: 6.9 6 6 Requires PHP: 5.6 7 Stable tag: 2.13. 67 Stable tag: 2.13.7 8 8 9 9 License: GNU General Public License v3.0 or later … … 326 326 327 327 == Changelog == 328 = 2.13.7 - 27.01.2026 = 329 Fixed: Security issues. 330 328 331 = 2.13.6 - 20.01.2026 = 329 332 Fixed: Gutenberg block editor was throwing an error due to circular references. 330 333 331 = 2.13.5 - 14.12.2025 =332 Fixed: Fatal error when the theme enqueues styles for all widgets.333 Fixed: Security issues.334 335 = 2.13.4 - 08.12.2025 =336 Fixed: Security issues.337 338 = 2.13.3 - 02.12.2025 =339 Fixed: Vulnerability in zip import.340 341 = 2.13.2 - 19.11.2025 =342 Updated: Performance improvements.343 344 = 2.13.1 - 14.11.2025 =345 Added: Enhancements for zip import.346 347 = 2.13.0 - 12.11.2025 =348 Added: Yoast/Rank Math/SEOPress image sitemaps.349 350 = 2.12.30 - 11.11.2025 =351 Fixed: Improved remote requests handling.352 353 = 2.12.29 - 07.11.2025 =354 Fixed: Security issue.355 356 = 2.12.28 - 05.11.2025 =357 Added: Filters to exclude Modula JS files from third-party optimization plugins.358 Added: Black Friday upsells & notifications updates.359 Fixed: Missing data-image-id on lightbox link.360 361 = 2.12.27 - 24.10.2025 =362 Fixed: Left/Right thumbnail navigation.363 Fixed: Lightbox image display.364 Fixed: Custom gallery Guttenberg preview.365 Fixed: Divi builder compatibility.366 367 = 2.12.26 - 20.10.2025 =368 Updated: Fancybox Lightbox to version 5.0.36.369 Changed: Enabled the Custom Responsiveness setting by default for a better out of the box experience.370 Fixed: Missing text domains in some strings.371 Fixed: Load in view setting causing gallery images to remain hidden.372 Added: Debounce on window resize.373 Added: Interactive elements now include proper button roles and visible focus indicators, improving WCAG 2.1 compliance.374 375 = 2.12.25 - 18.09.2025 =376 Update: Better fit for social icons when using smaller images.377 378 = 2.12.23 - 29.08.2025 =379 Update: Share icons.380 Added: Collapsable social buttons for desktop and set default to be collapsed.381 382 = 2.12.22 - 28.08.2025 =383 Fixed: Social icons hover display issue.384 385 = 2.12.21 - 27.08.2025 =386 Fixed: Loading effect 'in view' setting not properly working.387 388 = 2.12.20 - 20.08.2025 =389 Fixed: Gallery jumping/scrolling issue in Elementor due to lazy load re-rendering.390 391 = 2.12.19 - 12.08.2025 =392 Fixed: Broken lightbox images when original image type was .heic.393 394 = 2.12.18 - 28.07.2025 =395 Added: Filter `modula_show_alignment_options` to allow enabling image alignment options.396 Fixed: Inconsistency between masonry script responsive breakpoints and CSS breakpoints.397 398 = 2.12.17 - 22.07.2025 =399 Added: Compatibility with Translatepress.400 401 = 2.12.16 - 14.07.2025 =402 Enhancement: The `modula_gallery_images` filter now receives the `gallery_id` parameter, allowing for more context-aware modifications.403 404 = 2.12.15 - 08.07.2025 =405 Added: Compatibility with Imagify and Modula Lazy Load option.406 407 = 2.12.14 - 07.07.2025 =408 Fixed: PHP warning when image has no valign or halign.409 410 = 2.12.13 - 24.06.2025 =411 Added: Compatibility with Imagify.412 413 = 2.12.12 - 13.05.2025 =414 Fixed: Security update415 416 = 2.12.11 - 26.03.2025 =417 Fixed: Import sources are now queried only on the Modula settings page.418 Update: Improved code formatting for the gallery template.419 420 = 2.12.10 - 19.03.2025 =421 Updated: Twitter icon to X icon.422 Added: Upsells in gallery edit screen.423 424 = 2.12.9 – 18.03.2025 =425 Changed: Removed tooltips.426 Update: Links to online knowledge base.427 Update: Default gallery type set to Masonry.428 Update: Title and Caption default size values.429 Update: Removed Misc tab from general settings.430 431 = 2.12.8 - 15.03.2025 =432 Added: Performance improvements in gallery listing page.433 434 = 2.12.7 - 12.03.2025 =435 Fixed: Fixes a PHP error occurring in certain scenarios436 437 = 2.12.6 - 11.03.2025 =438 Update: Notification system to WPChill Notification System.439 Fixed: Custom galleries preview images wrong scaling after image/bulk edit.440 Added: Upsells for Modula Comments.441 Fixed: Fixed: PHP Warning442 443 = 2.12.5 - 07.03.2025 =444 Fixed: Escaping of links in image's title & caption.445 446 = 2.12.4 - 06.03.2025 =447 Fixed: Not displaying image metadata properly448 Fixed: Saving image metadata on gallery edit449 450 = 2.12.3 - 05.03.2025 =451 Fixed: Do not strip image's title & caption html tags on image edit.452 453 = 2.12.2 - 05.03.2025 =454 Fixed: Plugin loading order.455 456 = 2.12.1 – 03.03.2025 =457 Fixed: AI Image Optimizer update method.458 459 = 2.12.0 – 28.02.2025 =460 Added: AI Image Optimizer.461 462 = 2.11.11 – 07.01.2025 =463 Fixed: ZIP file vulnerability fix.464 465 See the full changelog [here](https://github.com/WPChill/modula-lite/blob/master/changelog.txt).466 467 == Upgrade Notice ==468 469 = 2.11.11 =470 This update resolved a vulnerability for ZIP files! -
modula-best-grid-gallery/trunk/Modula.php
r3443192 r3447757 5 5 * Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks. 6 6 * Author: WPChill 7 * Version: 2.13. 67 * Version: 2.13.7 8 8 * Author URI: https://www.wpchill.com/ 9 9 * License: GPLv3 or later … … 48 48 */ 49 49 50 define( 'MODULA_LITE_VERSION', '2.13. 6' );50 define( 'MODULA_LITE_VERSION', '2.13.7' ); 51 51 define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) ); 52 52 define( 'MODULA_URL', plugin_dir_url( __FILE__ ) ); -
modula-best-grid-gallery/trunk/assets/js/admin/editor-plugin.js
r3262199 r3447757 1 1 (function () { 2 tinymce.create('tinymce.plugins.Modula', {2 tinymce.create('tinymce.plugins.Modula', { 3 3 init: function (ed, url) { 4 4 ed.addCommand('modula_shortcode_editor', function () { 5 var nonce = typeof modulaEditorNonce !== 'undefined' ? modulaEditorNonce : ''; 6 var ajaxUrl = ajaxurl + '?action=modula_shortcode_editor'; 7 if (nonce) { 8 ajaxUrl += '&nonce=' + encodeURIComponent(nonce); 9 } 5 10 ed.windowManager.open( 6 11 { 7 file: ajax url + '?action=modula_shortcode_editor',12 file: ajaxUrl, 8 13 width: 9 14 900 + parseInt(ed.getLang('button.delta_width', 0)), -
modula-best-grid-gallery/trunk/assets/js/admin/editor-plugin.min.js
r2982490 r3447757 1 tinymce.create("tinymce.plugins.Modula",{init:function( t,o){t.addCommand("modula_shortcode_editor",(function(){t.windowManager.open({file:ajaxurl+"?action=modula_shortcode_editor",width:900+parseInt(t.getLang("button.delta_width",0)),height:500+parseInt(t.getLang("button.delta_height",0)),inline:1},{plugin_url:o})}));var e=o.split("assets/");t.addButton("modula_shortcode_editor",{title:"Modula Gallery",cmd:"modula_shortcode_editor",image:e[0]+"assets/images/modula-logo.jpg"})},getInfo:function(){return{longname:"Modula Gallery",author:"Macho Themes",authorurl:"https://www.machothemes.com/",infourl:"https://www.machothemes.com/",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("modula_shortcode_editor",tinymce.plugins.Modula);1 tinymce.create("tinymce.plugins.Modula",{init:function(o,e){o.addCommand("modula_shortcode_editor",(function(){var t="undefined"!=typeof modulaEditorNonce?modulaEditorNonce:"",n=ajaxurl+"?action=modula_shortcode_editor";t&&(n+="&nonce="+encodeURIComponent(t)),o.windowManager.open({file:n,width:900+parseInt(o.getLang("button.delta_width",0)),height:500+parseInt(o.getLang("button.delta_height",0)),inline:1},{plugin_url:e})}));var t=e.split("assets/");o.addButton("modula_shortcode_editor",{title:"Modula Gallery",cmd:"modula_shortcode_editor",image:t[0]+"assets/images/modula-logo.jpg"})},getInfo:function(){return{longname:"Modula Gallery",author:"Macho Themes",authorurl:"https://www.machothemes.com/",infourl:"https://www.machothemes.com/",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("modula_shortcode_editor",tinymce.plugins.Modula); -
modula-best-grid-gallery/trunk/changelog.txt
r3443192 r3447757 1 = 2.13.7 - 27.01.2026 = 2 Fixed: Security issues. 3 1 4 = 2.13.6 - 20.01.2026 = 2 5 Fixed: Gutenberg block editor was throwing an error due to circular references. -
modula-best-grid-gallery/trunk/includes/admin/class-modula-cpt.php
r3352565 r3447757 225 225 $modula_images = $this->sanitize_images( $value ); 226 226 227 $this->batch_update_images( $modula_images, $obj->ID ); 228 227 // Validate and filter out invalid attachment IDs before processing 228 $valid_images = array(); 229 foreach ( $modula_images as $image ) { 230 if ( ! isset( $image['id'] ) || empty( $image['id'] ) ) { 231 continue; 232 } 233 234 $attachment_id = absint( $image['id'] ); 235 if ( ! $attachment_id ) { 236 continue; 237 } 238 239 // Security check: Verify the ID is an attachment 240 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 241 continue; 242 } 243 244 // Security check: Verify user has permission to edit this attachment 245 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 246 continue; 247 } 248 249 $valid_images[] = $image; 250 } 251 252 // Only update with valid attachments 253 $this->batch_update_images( $valid_images, $obj->ID ); 254 255 // Update gallery meta with filtered valid images 229 256 update_post_meta( 230 257 $obj->ID, 231 258 'modula-images', 232 $ modula_images259 $valid_images 233 260 ); 234 261 } … … 253 280 254 281 // We’ll process in chunks to avoid overly large queries 282 // Additional security: Filter out any invalid attachments that may have slipped through 283 $valid_images = array(); 284 foreach ( $images as $image ) { 285 if ( ! isset( $image['id'] ) || empty( $image['id'] ) ) { 286 continue; 287 } 288 289 $attachment_id = absint( $image['id'] ); 290 if ( ! $attachment_id ) { 291 continue; 292 } 293 294 // Security check: Verify the ID is an attachment 295 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 296 continue; 297 } 298 299 // Security check: Verify user has permission to edit this attachment 300 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 301 continue; 302 } 303 304 $valid_images[] = $image; 305 } 306 307 if ( empty( $valid_images ) ) { 308 return; 309 } 310 255 311 $batch_size = 200; 256 $chunks = array_chunk( $ images, $batch_size );312 $chunks = array_chunk( $valid_images, $batch_size ); 257 313 258 314 foreach ( $chunks as $chunk ) { … … 267 323 global $wpdb; 268 324 269 // 1) Collect a ll relevant attachment IDs325 // 1) Collect and validate all relevant attachment IDs 270 326 $attachment_ids = array(); 327 $valid_images = array(); 328 271 329 foreach ( $images_chunk as $image ) { 272 if ( ! empty( $image['id'] ) ) { 273 $attachment_ids[] = absint( $image['id'] ); 274 } 275 } 276 $attachment_ids = array_filter( $attachment_ids ); 330 if ( ! isset( $image['id'] ) || empty( $image['id'] ) ) { 331 continue; 332 } 333 334 $attachment_id = absint( $image['id'] ); 335 if ( ! $attachment_id ) { 336 continue; 337 } 338 339 // Security check: Verify the ID is an attachment 340 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 341 continue; 342 } 343 344 // Security check: Verify user has permission to edit this attachment 345 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 346 continue; 347 } 348 349 $attachment_ids[] = $attachment_id; 350 $valid_images[] = $image; 351 } 352 277 353 $attachment_ids = array_unique( $attachment_ids ); 278 354 … … 323 399 $meta_inserts = array(); // We'll insert the new alt rows 324 400 325 // 4) Loop through images and build the final updates only if needed326 foreach ( $ images_chunkas $image ) {401 // 4) Loop through valid images and build the final updates only if needed 402 foreach ( $valid_images as $image ) { 327 403 $attachment_id = isset( $image['id'] ) ? absint( $image['id'] ) : 0; 328 404 if ( ! $attachment_id ) { 405 continue; 406 } 407 408 // Additional security check: Verify the ID is still an attachment (defense in depth) 409 if ( 'attachment' !== get_post_type( $attachment_id ) ) { 410 continue; 411 } 412 413 // Additional security check: Verify user still has permission (defense in depth) 414 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 329 415 continue; 330 416 } -
modula-best-grid-gallery/trunk/includes/class-modula.php
r3394968 r3447757 168 168 add_filter( 'mce_external_plugins', array( $this, 'register_editor_plugin' ) ); 169 169 add_action( 'wp_ajax_modula_shortcode_editor', array( $this, 'modula_shortcode_editor' ) ); 170 add_action( 'admin_print_scripts', array( $this, 'add_editor_nonce' ) ); 170 171 171 172 // Allow other mime types to be uploaded … … 543 544 544 545 /** 546 * Add nonce for TinyMCE editor plugin 547 */ 548 public function add_editor_nonce() { 549 $screen = get_current_screen(); 550 // Only add nonce on post edit screens where TinyMCE is available 551 if ( ! $screen || ! in_array( $screen->base, array( 'post', 'page' ), true ) ) { 552 return; 553 } 554 ?> 555 <script type="text/javascript"> 556 var modulaEditorNonce = '<?php echo esc_js( wp_create_nonce( 'modula-ajax-save' ) ); ?>'; 557 </script> 558 <?php 559 } 560 561 /** 545 562 * Display galleries selection 546 563 */ 547 564 public function modula_shortcode_editor() { 565 // Check user capability 566 if ( ! current_user_can( 'edit_posts' ) ) { 567 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'modula-best-grid-gallery' ) ); 568 } 569 570 // Verify nonce 571 $nonce = ''; 572 if ( isset( $_REQUEST['nonce'] ) ) { 573 $nonce = sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ); 574 } 575 576 if ( ! wp_verify_nonce( $nonce, 'modula-ajax-save' ) ) { 577 wp_die( esc_html__( 'Security check failed.', 'modula-best-grid-gallery' ) ); 578 } 579 548 580 $css_path = MODULA_URL . 'assets/css/admin/edit.css'; 549 581 $admin_url = admin_url(); -
modula-best-grid-gallery/trunk/readme.txt
r3443192 r3447757 5 5 Tested up to: 6.9 6 6 Requires PHP: 5.6 7 Stable tag: 2.13. 67 Stable tag: 2.13.7 8 8 9 9 License: GNU General Public License v3.0 or later … … 326 326 327 327 == Changelog == 328 = 2.13.7 - 27.01.2026 = 329 Fixed: Security issues. 330 328 331 = 2.13.6 - 20.01.2026 = 329 332 Fixed: Gutenberg block editor was throwing an error due to circular references. 330 333 331 = 2.13.5 - 14.12.2025 =332 Fixed: Fatal error when the theme enqueues styles for all widgets.333 Fixed: Security issues.334 335 = 2.13.4 - 08.12.2025 =336 Fixed: Security issues.337 338 = 2.13.3 - 02.12.2025 =339 Fixed: Vulnerability in zip import.340 341 = 2.13.2 - 19.11.2025 =342 Updated: Performance improvements.343 344 = 2.13.1 - 14.11.2025 =345 Added: Enhancements for zip import.346 347 = 2.13.0 - 12.11.2025 =348 Added: Yoast/Rank Math/SEOPress image sitemaps.349 350 = 2.12.30 - 11.11.2025 =351 Fixed: Improved remote requests handling.352 353 = 2.12.29 - 07.11.2025 =354 Fixed: Security issue.355 356 = 2.12.28 - 05.11.2025 =357 Added: Filters to exclude Modula JS files from third-party optimization plugins.358 Added: Black Friday upsells & notifications updates.359 Fixed: Missing data-image-id on lightbox link.360 361 = 2.12.27 - 24.10.2025 =362 Fixed: Left/Right thumbnail navigation.363 Fixed: Lightbox image display.364 Fixed: Custom gallery Guttenberg preview.365 Fixed: Divi builder compatibility.366 367 = 2.12.26 - 20.10.2025 =368 Updated: Fancybox Lightbox to version 5.0.36.369 Changed: Enabled the Custom Responsiveness setting by default for a better out of the box experience.370 Fixed: Missing text domains in some strings.371 Fixed: Load in view setting causing gallery images to remain hidden.372 Added: Debounce on window resize.373 Added: Interactive elements now include proper button roles and visible focus indicators, improving WCAG 2.1 compliance.374 375 = 2.12.25 - 18.09.2025 =376 Update: Better fit for social icons when using smaller images.377 378 = 2.12.23 - 29.08.2025 =379 Update: Share icons.380 Added: Collapsable social buttons for desktop and set default to be collapsed.381 382 = 2.12.22 - 28.08.2025 =383 Fixed: Social icons hover display issue.384 385 = 2.12.21 - 27.08.2025 =386 Fixed: Loading effect 'in view' setting not properly working.387 388 = 2.12.20 - 20.08.2025 =389 Fixed: Gallery jumping/scrolling issue in Elementor due to lazy load re-rendering.390 391 = 2.12.19 - 12.08.2025 =392 Fixed: Broken lightbox images when original image type was .heic.393 394 = 2.12.18 - 28.07.2025 =395 Added: Filter `modula_show_alignment_options` to allow enabling image alignment options.396 Fixed: Inconsistency between masonry script responsive breakpoints and CSS breakpoints.397 398 = 2.12.17 - 22.07.2025 =399 Added: Compatibility with Translatepress.400 401 = 2.12.16 - 14.07.2025 =402 Enhancement: The `modula_gallery_images` filter now receives the `gallery_id` parameter, allowing for more context-aware modifications.403 404 = 2.12.15 - 08.07.2025 =405 Added: Compatibility with Imagify and Modula Lazy Load option.406 407 = 2.12.14 - 07.07.2025 =408 Fixed: PHP warning when image has no valign or halign.409 410 = 2.12.13 - 24.06.2025 =411 Added: Compatibility with Imagify.412 413 = 2.12.12 - 13.05.2025 =414 Fixed: Security update415 416 = 2.12.11 - 26.03.2025 =417 Fixed: Import sources are now queried only on the Modula settings page.418 Update: Improved code formatting for the gallery template.419 420 = 2.12.10 - 19.03.2025 =421 Updated: Twitter icon to X icon.422 Added: Upsells in gallery edit screen.423 424 = 2.12.9 – 18.03.2025 =425 Changed: Removed tooltips.426 Update: Links to online knowledge base.427 Update: Default gallery type set to Masonry.428 Update: Title and Caption default size values.429 Update: Removed Misc tab from general settings.430 431 = 2.12.8 - 15.03.2025 =432 Added: Performance improvements in gallery listing page.433 434 = 2.12.7 - 12.03.2025 =435 Fixed: Fixes a PHP error occurring in certain scenarios436 437 = 2.12.6 - 11.03.2025 =438 Update: Notification system to WPChill Notification System.439 Fixed: Custom galleries preview images wrong scaling after image/bulk edit.440 Added: Upsells for Modula Comments.441 Fixed: Fixed: PHP Warning442 443 = 2.12.5 - 07.03.2025 =444 Fixed: Escaping of links in image's title & caption.445 446 = 2.12.4 - 06.03.2025 =447 Fixed: Not displaying image metadata properly448 Fixed: Saving image metadata on gallery edit449 450 = 2.12.3 - 05.03.2025 =451 Fixed: Do not strip image's title & caption html tags on image edit.452 453 = 2.12.2 - 05.03.2025 =454 Fixed: Plugin loading order.455 456 = 2.12.1 – 03.03.2025 =457 Fixed: AI Image Optimizer update method.458 459 = 2.12.0 – 28.02.2025 =460 Added: AI Image Optimizer.461 462 = 2.11.11 – 07.01.2025 =463 Fixed: ZIP file vulnerability fix.464 465 See the full changelog [here](https://github.com/WPChill/modula-lite/blob/master/changelog.txt).466 467 == Upgrade Notice ==468 469 = 2.11.11 =470 This update resolved a vulnerability for ZIP files!
Note: See TracChangeset
for help on using the changeset viewer.