diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index cdb460f3a..d1a19d86c 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -20,10 +20,10 @@ jobs: name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3.5.3 # get the PHP version - - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@2.25.5 with: php-version: ${{ matrix.php }} - name: Installing WordPress diff --git a/admin/class-uninstall-admin-page.php b/admin/class-uninstall-admin-page.php index ec3bcfc06..125c19a0c 100644 --- a/admin/class-uninstall-admin-page.php +++ b/admin/class-uninstall-admin-page.php @@ -46,6 +46,12 @@ public function dispatch() { $dirname = $this->settings->get_runtime_option( 'awpcp-uploads-dir' ); if ( 0 === strcmp( $action, 'uninstall' ) ) { + // Check the wp_nonce_url. + $nonce = awpcp_get_var( array( 'param' => '_wpnonce' ), 'get' ); + if ( ! wp_verify_nonce( $nonce, 'awpcp-uninstall' ) || ! awpcp_current_user_is_admin() ) { + wp_die( esc_html__( 'You are not authorized to perform this action.', 'another-wordpress-classifieds-plugin' ) ); + } + $this->uninstaller->uninstall(); } diff --git a/admin/templates/admin-panel-uninstall.tpl.php b/admin/templates/admin-panel-uninstall.tpl.php index bb20c66ab..4d275e794 100644 --- a/admin/templates/admin-panel-uninstall.tpl.php +++ b/admin/templates/admin-panel-uninstall.tpl.php @@ -24,8 +24,9 @@
- 'uninstall' ), $url ); ?> - + + +
@@ -33,7 +34,9 @@- + + +