Skip to content

Commit 2c07ac3

Browse files
committed
fix(other): handle missing IMAP configuration when using modules such github
1 parent 044bdc2 commit 2c07ac3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/github/modules.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ protected function output() {
439439
$res .= '<i class="bi bi-code-slash account_icon"></i> ';
440440
}
441441
$repo_parts = explode('/', urldecode($repo));
442-
$repo_display_name = isset($repo_parts[1]) ? $repo_parts[1] : $repo;
442+
$repo_display_name = count($repo_parts) > 1 ? $repo_parts[1] : urldecode($repo);
443443
$res .= $this->html_safe($repo_display_name).'</a></li>';
444444
}
445445
$this->append('folder_sources', array('github_folders', $res));
@@ -464,11 +464,8 @@ protected function output() {
464464
}
465465
$repo_id = $this->get('github_data_source_id');
466466
$repo = $this->get('github_data_source', 'Github');
467-
if (empty($this->get('github_data')) || $repo === 'Github') {
468-
return;
469-
}
470467
$repo_parts = explode('/', $repo);
471-
$repo_name = isset($repo_parts[1]) ? $repo_parts[1] : 'Github';
468+
$repo_name = count($repo_parts) > 1 ? $repo_parts[1] : $repo;
472469
$cutoff = $this->get('github_list_since', '');
473470
if ($cutoff) {
474471
$cutoff = strtotime($cutoff);

modules/imap/handler_modules.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,9 @@ public function process() {
13941394
foreach ($ids as $key => $id) {
13951395
$details = Hm_IMAP_List::dump($id);
13961396
$mailbox = Hm_IMAP_List::get_connected_mailbox($id, $this->cache);
1397+
if (!$mailbox || !$mailbox->authed()) {
1398+
continue;
1399+
}
13971400
if($this->get('list_path') == 'snoozed' && !$mailbox->folder_exists('Snoozed')) {
13981401
continue;
13991402
}

0 commit comments

Comments
 (0)