Просмотр исходного кода

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 4 лет назад
Родитель
Сommit
925261b566
1 измененных файлов с 8 добавлено и 8 удалено
  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;
 	}