Plugin Directory

Changeset 3469008


Ignore:
Timestamp:
02/25/2026 03:01:06 AM (5 weeks ago)
Author:
webangon
Message:

Prefix nonce

Location:
news-element/trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • news-element/trunk/admin/inc/dash.php

    r3468177 r3469008  
    2222    public function ne_display_import_sites() {
    2323
    24         if ( !isset($_POST['nonce']) || !current_user_can('manage_options') || !wp_verify_nonce( sanitize_text_field(wp_unslash($_POST['nonce'])), 'wp_rest')) {
     24        if ( !isset($_POST['nonce']) || !current_user_can('manage_options') || !wp_verify_nonce( sanitize_text_field(wp_unslash($_POST['nonce'])), 'newselement-nonce')) {
    2525            exit;
    2626        }
    27 
     27 
    2828        $data = get_option('news24lib');
    2929
     
    135135               'ajax_url' => admin_url( 'admin-ajax.php' ),
    136136               'site_url' => home_url(),
     137               'nonce'    => wp_create_nonce( 'newselement-nonce' ),
    137138            );
    138139             wp_enqueue_script('ne_admin_demo', plugin_dir_url( __FILE__ ).'assets/admin.js',array('jquery','masonry'), NEWS_ELM_VERSION, true);
     
    165166    public static function ne_import_data(){
    166167
    167         if ( !isset($_POST['nonce']) || !current_user_can('manage_options') || !wp_verify_nonce( sanitize_text_field(wp_unslash($_POST['nonce'])), 'wp_rest')) {
     168        if ( !isset($_POST['nonce']) || !current_user_can('manage_options') || !wp_verify_nonce( sanitize_text_field(wp_unslash($_POST['nonce'])), 'newselement-nonce')) {
    168169            exit;
    169170        }
  • news-element/trunk/admin/lib/index.php

    r3468177 r3469008  
    9898        function ajax_data(){
    9999            //phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotValidated
    100             if (!current_user_can('manage_options') || !wp_verify_nonce( sanitize_text_field(wp_unslash($_POST['nonce'])), 'wp_rest')) {
     100            if (!current_user_can('manage_options') || !wp_verify_nonce( sanitize_text_field(wp_unslash($_POST['nonce'])), 'newselement-nonce')) {
    101101                exit;
    102102            }
Note: See TracChangeset for help on using the changeset viewer.