PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
← All changes | backend/src/Services/Preview/PreviewService.php +2 -6 0.9 → 1.5 View file →
@@ -1,16 +1,12 @@
1 1 <?php
2 2
3 3 namespace IvyForms\Services\Preview;
4 4
5 -// phpcs:disable PSR1.Files.SideEffects
6 -if (!defined('ABSPATH')) {
7 - exit; // Exit if accessed directly
8 -}
9 -
10 5 use IvyForms\Common\Exceptions\ForbiddenException;
11 6 use IvyForms\Common\Sanitizer\Sanitizer;
12 7 use IvyForms\Services\API\IvyFormsAPI;
8 +use IvyForms\Services\Permissions\IvyFormsAccess;
13 9 use stdClass;
14 10 use WP_Post;
15 11
16 12 /**
@@ -107,9 +103,9 @@
107 103 403
108 104 );
109 105 }
110 106
111 - if (!current_user_can('manage_options')) {
107 + if (!IvyFormsAccess::canAccessFormPreview()) {
112 108 wp_die(
113 109 esc_html__('Sorry, you are not allowed to visit this preview form as this user.', 'ivyforms'),
114 110 esc_html__('You need a higher level of permission.', 'ivyforms'),
115 111 403