Changeset 2919151
- Timestamp:
- 05/30/2023 02:04:18 PM (3 years ago)
- Location:
- wp-inventory-manager/trunk
- Files:
-
- 2 edited
-
includes/wpinventory.admin.class.php (modified) (3 diffs)
-
wpinventory.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-inventory-manager/trunk/includes/wpinventory.admin.class.php
r2666161 r2919151 752 752 } 753 753 } else if ( 'delete' == $action ) { 754 $inventory_id = self::request( 'delete_id' );755 $success = self::delete_item( $inventory_id);754 $inventory_id = self::request( 'delete_id' ); 755 $success = self::delete_item( $inventory_id, self::request( 'wp_nonce' ) ); 756 756 $action = ''; 757 757 } … … 852 852 $loop->the_item(); 853 853 $edit_url = ( self::check_permission( 'view_item', $wpinventory_item->inventory_id ) ) ? self::$self_url . '&action=edit&inventory_id=' . $wpinventory_item->inventory_id : ''; 854 $delete_url = ( self::check_permission( 'edit_item', $wpinventory_item->inventory_id ) ) ? self::$self_url . '&action=delete&delete_id=' . $wpinventory_item->inventory_id : '';854 $delete_url = ( self::check_permission( 'edit_item', $wpinventory_item->inventory_id ) ) ? self::$self_url . '&action=delete&delete_id=' . $wpinventory_item->inventory_id . '&wp_nonce=' . wp_create_nonce( 'delete-item-' . $wpinventory_item->inventory_id ) : ''; 855 855 $duplicate_url = ( self::check_permission( 'view_item', $wpinventory_item->inventory_id ) ) ? self::$self_url . '&action=duplicate&duplicate_id=' . $wpinventory_item->inventory_id : ''; 856 856 … … 1448 1448 } 1449 1449 1450 public static function delete_item( ) {1450 public static function delete_item( $inventory_id, $nonce ) { 1451 1451 $inventory_id = (int) self::request( "delete_id" ); 1452 if ( ! $inventory_id) {1453 self::$error = self::__( ' Inventory id not set. Item not deleted.' );1452 if ( ! wp_verify_nonce( $nonce, 'delete-item-' . $inventory_id ) ) { 1453 self::$error = self::__( 'There was a problem deleting your inventory item. Invalid permissions.' ); 1454 1454 1455 1455 return FALSE; -
wp-inventory-manager/trunk/wpinventory.php
r2900836 r2919151 5 5 * Plugin URI: http://www.wpinventory.com 6 6 * Description: Manage and display your products just like a shopping cart, but without the cart. 7 * Version: 2.1.0.1 37 * Version: 2.1.0.14 8 8 * Author: WP Inventory Manager 9 9 * Author URI: http://www.wpinventory.com/ … … 34 34 35 35 abstract class WPIMConstants { 36 const VERSION = '2.1.0.1 3';36 const VERSION = '2.1.0.14'; 37 37 const MIN_PHP_VERSION = '5.6'; 38 38 const SHORTCODE = 'wpinventory';
Note: See TracChangeset
for help on using the changeset viewer.