kopia lustrzana https://github.com/newroco/mail2deck
Modify function to be accessible in lower versions of php.
rodzic
5b025184a0
commit
99b26c4bab
|
@ -62,7 +62,7 @@ if ($emails)
|
|||
$board = null;
|
||||
if(strstr($overview->to[0]->mailbox, '+')) {
|
||||
$board = substr($overview->to[0]->mailbox, strpos($overview->to[0]->mailbox, '+') + 1);
|
||||
if(str_contains($board, '+')) $board = str_replace('+', ' ', $board);
|
||||
if(strstr($board, '+')) $board = str_replace('+', ' ', $board);
|
||||
}
|
||||
|
||||
$data = new stdClass();
|
||||
|
|
|
@ -54,13 +54,18 @@ class DeckClass {
|
|||
}
|
||||
$boardId = $board->id;
|
||||
$boardName = $board->title;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($boardId) {
|
||||
$stacks = $this->apiCall("GET", NC_SERVER . "/index.php/apps/deck/api/v1.0/boards/$boardId/stacks");
|
||||
foreach($stacks as $stack)
|
||||
(strtolower($stack->title) == strtolower($stackFromMail)) ? $stackId = $stack->id : $stackId = $stacks[0]->id;
|
||||
foreach($stacks as $key => $stack)
|
||||
if(strtolower($stack->title) == strtolower($stackFromMail)) {
|
||||
$stackId = $stack->id;
|
||||
break;
|
||||
}
|
||||
if($key == array_key_last($stacks) && !isset($stackId)) $stackId = $stacks[0]->id;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -33,9 +33,9 @@ class MailClass {
|
|||
public function reply($sender, $response = null) {
|
||||
$server = NC_SERVER;
|
||||
|
||||
if(str_contains($server, "https://")) {
|
||||
if(strstr($server, "https://")) {
|
||||
$server = str_replace('https://', '', $server);
|
||||
} else if(str_contains($server, "http://")) {
|
||||
} else if(strstr($server, "http://")) {
|
||||
$server = str_replace('http://', '', $server);
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue