Changeset 3385033
- Timestamp:
- 10/27/2025 08:22:24 AM (3 months ago)
- Location:
- document-library-lite
- Files:
-
- 16 edited
- 1 copied
-
tags/1.1.7 (copied) (copied from document-library-lite/trunk)
-
tags/1.1.7/changelog.txt (modified) (1 diff)
-
tags/1.1.7/document-library-lite.php (modified) (2 diffs)
-
tags/1.1.7/readme.txt (modified) (2 diffs)
-
tags/1.1.7/src/Document_Library_Shortcode.php (modified) (1 diff)
-
tags/1.1.7/src/Frontend_Scripts.php (modified) (1 diff)
-
tags/1.1.7/src/Simple_Document_Library.php (modified) (1 diff)
-
tags/1.1.7/src/Table/Ajax_Handler.php (modified) (3 diffs)
-
tags/1.1.7/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/document-library-lite.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Document_Library_Shortcode.php (modified) (1 diff)
-
trunk/src/Frontend_Scripts.php (modified) (1 diff)
-
trunk/src/Simple_Document_Library.php (modified) (1 diff)
-
trunk/src/Table/Ajax_Handler.php (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
document-library-lite/tags/1.1.7/changelog.txt
r3375233 r3385033 1 = 1.1.7 = 2 Release date 27 October 2025 3 4 * Dev: Updated internal libraries 5 * Fix: Enhanced security for AJAX requests and adjusted post status handling 6 1 7 = 1.1.6 = 2 8 Release date 08 October 2025 -
document-library-lite/tags/1.1.7/document-library-lite.php
r3375233 r3385033 12 12 * Plugin URI: https://barn2.com/kb-categories/document-library-free-kb/ 13 13 * Description: Add documents and display them in a searchable document library. 14 * Version: 1.1. 614 * Version: 1.1.7 15 15 * Author: Barn2 Plugins 16 16 * Author URI: https://barn2.com … … 33 33 } 34 34 35 const PLUGIN_VERSION = '1.1. 6';35 const PLUGIN_VERSION = '1.1.7'; 36 36 const PLUGIN_FILE = __FILE__; 37 37 -
document-library-lite/tags/1.1.7/readme.txt
r3375233 r3385033 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 1.1. 68 Stable tag: 1.1.7 9 9 License: GPL-3.0 10 10 License URI: https://www.gnu.org/licenses/gpl.html … … 206 206 == Changelog == 207 207 208 = 1.1. 6=209 Release date 08October 2025208 = 1.1.7 = 209 Release date 27 October 2025 210 210 211 211 * Dev: Updated internal libraries 212 * Fix: Lazy loading did not working in block themes212 * Fix: Enhanced security for AJAX requests and adjusted post status handling 213 213 214 214 See changelog.txt for more details. -
document-library-lite/tags/1.1.7/src/Document_Library_Shortcode.php
r3375233 r3385033 62 62 self::$script_params = [ 63 63 'ajax_url' => admin_url( 'admin-ajax.php' ), 64 'ajax_nonce' => 'document-library',64 'ajax_nonce' => wp_create_nonce( 'dll_load_posts' ), 65 65 'ajax_action' => 'dll_load_posts', 66 66 'lazy_load' => $table->args['lazy_load'], -
document-library-lite/tags/1.1.7/src/Frontend_Scripts.php
r3375233 r3385033 75 75 76 76 $script_params = [ 77 'ajax_nonce' => wp_create_nonce( 'dll_load_posts' ), 77 78 'language' => apply_filters( 78 79 'document_library_lite_language_defaults', -
document-library-lite/tags/1.1.7/src/Simple_Document_Library.php
r3281091 r3385033 493 493 $valid_post_statuses = [ 'publish', 'pending', 'draft', 'future', 'any' ]; 494 494 $args[ 'status' ] = in_array( $args['status'], $valid_post_statuses ) ? $args[ 'status' ] : 'publish'; 495 495 496 496 return $args; 497 497 } -
document-library-lite/tags/1.1.7/src/Table/Ajax_Handler.php
r3157590 r3385033 24 24 add_action( 'wp_ajax_dll_load_posts', [ $this, 'load_posts' ] ); 25 25 add_action( 'wp_ajax_nopriv_dll_load_posts', [ $this, 'load_posts' ] ); 26 27 26 } 28 27 … … 31 30 32 31 public function load_posts() { 33 $args = Options::handle_shortcode_attribute_aliases( $_POST[ 'args' ] ); 32 // Parse and sanitize incoming args 33 $args = isset( $_POST['args'] ) ? Options::handle_shortcode_attribute_aliases( wp_unslash( $_POST['args'] ) ) : []; 34 34 $args = shortcode_atts( Options::get_defaults(), $args, self::SHORTCODE ); 35 36 $requested_status = isset( $args['status'] ) ? $args['status'] : 'publish'; 37 $is_logged_in = is_user_logged_in(); 38 39 // Unauthenticated users can ONLY see published content 40 if ( ! $is_logged_in ) { 41 $args['status'] = 'publish'; 42 } 43 // Authenticated users requesting non-published content must provide nonce and capability 44 elseif ( $requested_status !== 'publish' ) { 45 $nonce = ''; 46 if ( isset( $_POST['_ajax_nonce'] ) ) { 47 $nonce = sanitize_text_field( wp_unslash( $_POST['_ajax_nonce'] ) ); 48 } elseif ( isset( $_POST['ajax_nonce'] ) ) { 49 $nonce = sanitize_text_field( wp_unslash( $_POST['ajax_nonce'] ) ); 50 } 51 52 if ( ! $nonce || ! wp_verify_nonce( $nonce, 'dll_load_posts' ) ) { 53 wp_send_json_error( [ 'message' => 'Security check failed' ], 403 ); 54 } 55 56 if ( ! current_user_can( 'edit_posts' ) ) { 57 wp_send_json_error( [ 'message' => 'Insufficient permissions' ], 403 ); 58 } 59 } 35 60 36 61 $table = new simple_Document_Library( $args ); … … 38 63 39 64 // Return the response as JSON 40 wp_send_json( $response);65 wp_send_json( $response ); 41 66 42 67 } -
document-library-lite/tags/1.1.7/vendor/composer/installed.php
r3375233 r3385033 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' ff62aee7e34351f3d8a11bb4c94a40c6a0e8888c',6 'reference' => 'cb7ae2775014c7bbcb88edc0e119b09b8afd891d', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' ff62aee7e34351f3d8a11bb4c94a40c6a0e8888c',16 'reference' => 'cb7ae2775014c7bbcb88edc0e119b09b8afd891d', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
document-library-lite/trunk/changelog.txt
r3375233 r3385033 1 = 1.1.7 = 2 Release date 27 October 2025 3 4 * Dev: Updated internal libraries 5 * Fix: Enhanced security for AJAX requests and adjusted post status handling 6 1 7 = 1.1.6 = 2 8 Release date 08 October 2025 -
document-library-lite/trunk/document-library-lite.php
r3375233 r3385033 12 12 * Plugin URI: https://barn2.com/kb-categories/document-library-free-kb/ 13 13 * Description: Add documents and display them in a searchable document library. 14 * Version: 1.1. 614 * Version: 1.1.7 15 15 * Author: Barn2 Plugins 16 16 * Author URI: https://barn2.com … … 33 33 } 34 34 35 const PLUGIN_VERSION = '1.1. 6';35 const PLUGIN_VERSION = '1.1.7'; 36 36 const PLUGIN_FILE = __FILE__; 37 37 -
document-library-lite/trunk/readme.txt
r3375233 r3385033 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 1.1. 68 Stable tag: 1.1.7 9 9 License: GPL-3.0 10 10 License URI: https://www.gnu.org/licenses/gpl.html … … 206 206 == Changelog == 207 207 208 = 1.1. 6=209 Release date 08October 2025208 = 1.1.7 = 209 Release date 27 October 2025 210 210 211 211 * Dev: Updated internal libraries 212 * Fix: Lazy loading did not working in block themes212 * Fix: Enhanced security for AJAX requests and adjusted post status handling 213 213 214 214 See changelog.txt for more details. -
document-library-lite/trunk/src/Document_Library_Shortcode.php
r3375233 r3385033 62 62 self::$script_params = [ 63 63 'ajax_url' => admin_url( 'admin-ajax.php' ), 64 'ajax_nonce' => 'document-library',64 'ajax_nonce' => wp_create_nonce( 'dll_load_posts' ), 65 65 'ajax_action' => 'dll_load_posts', 66 66 'lazy_load' => $table->args['lazy_load'], -
document-library-lite/trunk/src/Frontend_Scripts.php
r3375233 r3385033 75 75 76 76 $script_params = [ 77 'ajax_nonce' => wp_create_nonce( 'dll_load_posts' ), 77 78 'language' => apply_filters( 78 79 'document_library_lite_language_defaults', -
document-library-lite/trunk/src/Simple_Document_Library.php
r3281091 r3385033 493 493 $valid_post_statuses = [ 'publish', 'pending', 'draft', 'future', 'any' ]; 494 494 $args[ 'status' ] = in_array( $args['status'], $valid_post_statuses ) ? $args[ 'status' ] : 'publish'; 495 495 496 496 return $args; 497 497 } -
document-library-lite/trunk/src/Table/Ajax_Handler.php
r3157590 r3385033 24 24 add_action( 'wp_ajax_dll_load_posts', [ $this, 'load_posts' ] ); 25 25 add_action( 'wp_ajax_nopriv_dll_load_posts', [ $this, 'load_posts' ] ); 26 27 26 } 28 27 … … 31 30 32 31 public function load_posts() { 33 $args = Options::handle_shortcode_attribute_aliases( $_POST[ 'args' ] ); 32 // Parse and sanitize incoming args 33 $args = isset( $_POST['args'] ) ? Options::handle_shortcode_attribute_aliases( wp_unslash( $_POST['args'] ) ) : []; 34 34 $args = shortcode_atts( Options::get_defaults(), $args, self::SHORTCODE ); 35 36 $requested_status = isset( $args['status'] ) ? $args['status'] : 'publish'; 37 $is_logged_in = is_user_logged_in(); 38 39 // Unauthenticated users can ONLY see published content 40 if ( ! $is_logged_in ) { 41 $args['status'] = 'publish'; 42 } 43 // Authenticated users requesting non-published content must provide nonce and capability 44 elseif ( $requested_status !== 'publish' ) { 45 $nonce = ''; 46 if ( isset( $_POST['_ajax_nonce'] ) ) { 47 $nonce = sanitize_text_field( wp_unslash( $_POST['_ajax_nonce'] ) ); 48 } elseif ( isset( $_POST['ajax_nonce'] ) ) { 49 $nonce = sanitize_text_field( wp_unslash( $_POST['ajax_nonce'] ) ); 50 } 51 52 if ( ! $nonce || ! wp_verify_nonce( $nonce, 'dll_load_posts' ) ) { 53 wp_send_json_error( [ 'message' => 'Security check failed' ], 403 ); 54 } 55 56 if ( ! current_user_can( 'edit_posts' ) ) { 57 wp_send_json_error( [ 'message' => 'Insufficient permissions' ], 403 ); 58 } 59 } 35 60 36 61 $table = new simple_Document_Library( $args ); … … 38 63 39 64 // Return the response as JSON 40 wp_send_json( $response);65 wp_send_json( $response ); 41 66 42 67 } -
document-library-lite/trunk/vendor/composer/installed.php
r3375233 r3385033 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' ff62aee7e34351f3d8a11bb4c94a40c6a0e8888c',6 'reference' => 'cb7ae2775014c7bbcb88edc0e119b09b8afd891d', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' ff62aee7e34351f3d8a11bb4c94a40c6a0e8888c',16 'reference' => 'cb7ae2775014c7bbcb88edc0e119b09b8afd891d', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.