PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/Helpers/global/ajax.php +0 -47 trunk → 11.1.1 View file →
@@ -1,47 +1,0 @@
1 -<?php
2 -defined('ABSPATH') || die('Restricted Access');
3 -
4 -function acym_getAllHeaders(): array
5 -{
6 - if (function_exists('getallheaders')) {
7 - return getallheaders();
8 - }
9 -
10 - $headers = [];
11 -
12 - foreach ($_SERVER as $name => $value) {
13 - if (substr($name, 0, 5) === 'HTTP_') {
14 - $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
15 - } else {
16 - $headers[$name] = $value;
17 - }
18 - }
19 -
20 - return $headers;
21 -}
22 -
23 -function acym_getHeader(string $headerName): string
24 -{
25 - $allHeaders = acym_getAllHeaders();
26 -
27 - if (!empty($allHeaders[$headerName])) {
28 - return $allHeaders[$headerName];
29 - }
30 -
31 - return '';
32 -}
33 -
34 -function acym_isAjax(): bool
35 -{
36 - $allHeaders = acym_getAllHeaders();
37 -
38 - if (!empty($allHeaders['Accept'])) {
39 - $headerAccept = $allHeaders['Accept'];
40 - } elseif (!empty($allHeaders['accept'])) {
41 - $headerAccept = $allHeaders['accept'];
42 - } else {
43 - $headerAccept = '';
44 - }
45 -
46 - return strpos($headerAccept, 'application/json') !== false;
47 -}