Procházet zdrojové kódy

Instead of returning an empty array when the counts of urlList and tokenList arent equal the code is checking now if theres is an entry in the tokenList for every url from urlList. That makes it possible that there could be a least one working pair of url & token which leads to a working calendar.

Steven Günther před 4 roky
rodič
revize
925261b566
1 změnil soubory, kde provedl 8 přidání a 8 odebrání
  1. 8 8
      api/functions/homepage-connect-functions.php

+ 8 - 8
api/functions/homepage-connect-functions.php

@@ -8,14 +8,14 @@ trait HomepageConnectFunctions
 		$list = array();
 		$urlList = explode(',', $url);
 		$tokenList = explode(',', $token);
-		if (count($urlList) == count($tokenList)) {
-			foreach ($urlList as $key => $value) {
-				$list[$key] = array(
-					'url' => $this->qualifyURL($value),
-					'token' => $tokenList[$key]
-				);
-			}
-		}
+        foreach ($urlList as $key => $value) {
+            if (isset($tokenList[$key])) {
+                $list[$key] = array(
+                    'url' => $this->qualifyURL($value),
+                    'token' => $tokenList[$key]
+                );
+            }
+        }
 		return $list;
 	}