Changeset 3424391
- Timestamp:
- 12/20/2025 11:26:59 PM (3 months ago)
- Location:
- acf-galerie-4/trunk
- Files:
-
- 3 edited
-
acf-galerie-4.php (modified) (2 diffs)
-
providers/class.migration.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acf-galerie-4/trunk/acf-galerie-4.php
r3337745 r3424391 9 9 * License: GPL v2 or later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 * Version: 1.4. 211 * Version: 1.4.3 12 12 * Domain Path: /lang 13 13 * Requires PHP: 7.4 … … 24 24 25 25 public function initialize() { 26 $this->define( 'ACFG4_VERSION', '1.4. 2' );26 $this->define( 'ACFG4_VERSION', '1.4.3' ); 27 27 $this->define( 'ACFG4_PLUGIN', __FILE__ ); 28 28 $this->define( 'ACFG4_PLUGIN_BASENAME', plugin_basename( ACFG4_PLUGIN ) ); -
acf-galerie-4/trunk/providers/class.migration.php
r3237616 r3424391 19 19 20 20 function acfg4_start_migration_nonce() { 21 if ( ! is_admin() ) return;21 if ( ! current_user_can('manage_options') ) return; 22 22 $nonce = wp_create_nonce('acfg4_start_migration_nonce'); 23 23 ?> … … 27 27 28 28 public function enqueue_plugin_admin_scripts() { 29 wp_enqueue_script('acfg4-admin-script', ACFG4_PLUGIN_URL . 'assets/js/admin-script.js', ['jquery'], '1.0.0', true); 29 if ( current_user_can('manage_options') ) { 30 wp_enqueue_script('acfg4-admin-script', ACFG4_PLUGIN_URL . 'assets/js/admin-script.js', ['jquery'], '1.0.0', true); 31 } 30 32 } 31 33 32 34 public function enqueue_plugin_admin_styles() { 33 wp_enqueue_style('acfg4-admin-css', ACFG4_PLUGIN_URL . 'assets/css/admin-style.css', [], '1.0.0'); 35 if ( current_user_can('manage_options') ) { 36 wp_enqueue_style('acfg4-admin-css', ACFG4_PLUGIN_URL . 'assets/css/admin-style.css', [], '1.0.0'); 37 } 34 38 } 35 39 36 40 public function acfg4_start_migration() { 41 if ( ! current_user_can('manage_options') ) { 42 wp_send_json_error( 43 ['message' => 'Unauthorized'], 44 403 45 ); 46 } 47 48 if ( 49 ! isset($_POST['nonce']) || 50 ! wp_verify_nonce($_POST['nonce'], 'acfg4_start_migration_nonce') 51 ) { 52 wp_send_json_error( 53 ['message' => 'Invalid or missing nonce'], 54 400 55 ); 56 } 57 37 58 global $wpdb; 38 59 $wpdb->query('START TRANSACTION'); … … 40 61 try { 41 62 $migrate_from = $_POST['migrate_from']; 42 43 if (44 isset( $_POST['nonce'] ) &&45 !wp_verify_nonce( $_POST['nonce'], 'acfg4_start_migration_nonce') )46 {47 wp_send_json_error(['message' => "Nonce verification failed. Please try again."], 400);48 }49 63 50 64 if( !in_array( $migrate_from, [1, 2] ) ){ -
acf-galerie-4/trunk/readme.txt
r3419122 r3424391 5 5 Requires at least: 5.8 6 6 Tested up to: 6.9 7 Stable tag: 1.4. 27 Stable tag: 1.4.3 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 46 46 47 47 == Changelog == 48 = 1.4.3 = 49 * [Fixed] Added proper capability and nonce checks to migration process 50 48 51 = 1.4.2 = 49 52 * [Fixed] array_keys() expects array, null issue in PHP 8.x
Note: See TracChangeset
for help on using the changeset viewer.