From 4757a0fae058768d65d155fb51c6b5636d63bd25 Mon Sep 17 00:00:00 2001 From: Grzegorz Rola <grola@seostudio.pl> Date: Mon, 11 Mar 2024 12:47:48 +0100 Subject: [PATCH] bugfix(ajax): permission check --- src/WPDesk/Notice/AjaxHandler.php | 2 +- tests/codeception/tests/integration.suite.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/WPDesk/Notice/AjaxHandler.php b/src/WPDesk/Notice/AjaxHandler.php index fc3e674..64c8717 100644 --- a/src/WPDesk/Notice/AjaxHandler.php +++ b/src/WPDesk/Notice/AjaxHandler.php @@ -79,7 +79,7 @@ class AjaxHandler implements HookablePluginDependant { $noticeName = sanitize_text_field( $_POST[ self::POST_FIELD_NOTICE_NAME ] ); $option_name = PermanentDismissibleNotice::OPTION_NAME_PREFIX . $noticeName; - \ajax_check_referer( $option_name, self::POST_FIELD_SECURITY ); + ajax_check_referer( $option_name, self::POST_FIELD_SECURITY ); if ( ! current_user_can( 'edit_posts' ) ) { wp_send_json_error(); diff --git a/tests/codeception/tests/integration.suite.yml b/tests/codeception/tests/integration.suite.yml index 25ef607..1f3f494 100644 --- a/tests/codeception/tests/integration.suite.yml +++ b/tests/codeception/tests/integration.suite.yml @@ -32,6 +32,7 @@ modules: dbPassword: "%TEST_SITE_DB_PASSWORD%" isolatedInstall: false loadOnly: false + skipPluggables: false tablePrefix: "%TEST_SITE_TABLE_PREFIX%" plugins: [] activatePlugins: [] -- GitLab