PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.21.4
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.21.4
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
← All changes | includes/Core/Capability/Request.php +13 -7 2.02.21.4 View file →
@@ -3,10 +3,12 @@
3 3 namespace BitCode\BitForm\Core\Capability;
4 4
5 5 use BitCode\BitForm\Core\Util\FileDownloadProvider;
6 6
7 -final class Request {
8 - public static function Check($type) {
7 +final class Request
8 +{
9 + public static function Check($type)
10 + {
9 11 switch ($type) {
10 12 case 'admin':
11 13 return is_admin();
12 14
@@ -23,17 +25,21 @@
23 25 return (!is_admin() || defined('DOING_AJAX')) && !defined('DOING_CRON');
24 26 }
25 27 }
26 28
27 - public static function isPluginPage() {
28 - $queryToRemove = ['formID', 'entryID', 'fileID', 'download'];
29 - $parsed_url = parse_url(home_url());
29 + public static function isPluginPage()
30 + {
31 + $parsed_url = wp_parse_url(home_url());
30 32 $site_url = $parsed_url['scheme'] . '://' . $parsed_url['host'];
31 -
32 - $reqUrl = $site_url . remove_query_arg($queryToRemove, $_SERVER['REQUEST_URI']);
33 + $parsedReqUri = wp_parse_url($_SERVER['REQUEST_URI']);
34 + if (!isset($parsedReqUri['path'])) {
35 + return false;
36 + }
37 + $reqUrl = $site_url . $parsedReqUri['path'];
33 38 $downloadUrl = FileDownloadProvider::getBaseDownloadURL();
34 39 $reqUrl = '/' !== \substr($reqUrl, -1) ? $reqUrl . '/' : $reqUrl;
35 40 $downloadUrl = '/' !== \substr($downloadUrl, -1) ? $downloadUrl . '/' : $downloadUrl;
41 +
36 42 switch ($reqUrl) {
37 43 case $downloadUrl:{
38 44 return true;
39 45 }