| @@ -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,11 +25,12 @@ | ||
| 23 | 25 | return (!is_admin() || defined('DOING_AJAX')) && !defined('DOING_CRON'); |
| 24 | 26 | } |
| 25 | 27 | } |
| 26 | 28 | |
| 27 | - public static function isPluginPage() { | |
| 29 | + public static function isPluginPage() | |
| 30 | + { | |
| 28 | 31 | $queryToRemove = ['formID', 'entryID', 'fileID', 'download']; |
| 29 | - $parsed_url = parse_url(home_url()); | |
| 32 | + $parsed_url = wp_parse_url(home_url()); | |
| 30 | 33 | $site_url = $parsed_url['scheme'] . '://' . $parsed_url['host']; |
| 31 | 34 | |
| 32 | 35 | $reqUrl = $site_url . remove_query_arg($queryToRemove, $_SERVER['REQUEST_URI']); |
| 33 | 36 | $downloadUrl = FileDownloadProvider::getBaseDownloadURL(); |