Completed
Push — master ( c2c707...c52692 )
by Patrick
02:53
created
api/v1/index.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
 
7 7
 // array holding allowed Origin domains
8 8
 $allowedOrigins = array(
9
-  $settings->getGlobalSetting('www_url', 'https://www.burningflipside.com/'),
10
-  $settings->getGlobalSetting('wiki_url', 'https://wiki.burningflipside.com/'),
11
-  $settings->getGlobalSetting('profiles_url', 'https://profiles.burningflipside.com/'),
12
-  $settings->getGlobalSetting('secure_url', 'https://secure.burningflipside.com/')
9
+    $settings->getGlobalSetting('www_url', 'https://www.burningflipside.com/'),
10
+    $settings->getGlobalSetting('wiki_url', 'https://wiki.burningflipside.com/'),
11
+    $settings->getGlobalSetting('profiles_url', 'https://profiles.burningflipside.com/'),
12
+    $settings->getGlobalSetting('secure_url', 'https://secure.burningflipside.com/')
13 13
 );
14 14
 
15 15
 if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '') {
16
-  foreach ($allowedOrigins as $allowedOrigin) {
16
+    foreach ($allowedOrigins as $allowedOrigin) {
17 17
     if (preg_match('#' . $allowedOrigin . '#', $_SERVER['HTTP_ORIGIN'])) {
18 18
         header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
19 19
         header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         header('Access-Control-Allow-Headers: Authorization,Cookie,apikey');
22 22
         break;
23 23
     }
24
-  }
24
+    }
25 25
 }
26 26
 
27 27
 require_once('class.FlipREST.php');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
   $settings->getGlobalSetting('secure_url', 'https://secure.burningflipside.com/')
13 13
 );
14 14
 
15
-if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '') {
16
-  foreach ($allowedOrigins as $allowedOrigin) {
17
-    if (preg_match('#' . $allowedOrigin . '#', $_SERVER['HTTP_ORIGIN'])) {
18
-        header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
15
+if(isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '') {
16
+  foreach($allowedOrigins as $allowedOrigin) {
17
+    if(preg_match('#'.$allowedOrigin.'#', $_SERVER['HTTP_ORIGIN'])) {
18
+        header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']);
19 19
         header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
20 20
         header('Access-Control-Allow-Credentials: true');
21 21
         header('Access-Control-Allow-Headers: Authorization,Cookie,apikey');
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,9 +12,12 @@
 block discarded – undo
12 12
   $settings->getGlobalSetting('secure_url', 'https://secure.burningflipside.com/')
13 13
 );
14 14
 
15
-if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '') {
16
-  foreach ($allowedOrigins as $allowedOrigin) {
17
-    if (preg_match('#' . $allowedOrigin . '#', $_SERVER['HTTP_ORIGIN'])) {
15
+if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '')
16
+{
17
+  foreach ($allowedOrigins as $allowedOrigin)
18
+  {
19
+    if (preg_match('#' . $allowedOrigin . '#', $_SERVER['HTTP_ORIGIN']))
20
+    {
18 21
         header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
19 22
         header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
20 23
         header('Access-Control-Allow-Credentials: true');
Please login to merge, or discard this patch.