diff --git a/src/ext/notifications/class.sender.php b/src/ext/notifications/class.sender.php index 74358c8..ac3e715 100644 --- a/src/ext/notifications/class.sender.php +++ b/src/ext/notifications/class.sender.php @@ -20,7 +20,7 @@ class Sender function __construct(array $prefs, bool $useCli = false) { $this->prefs = $prefs; - if ($useCli && function_exists('pcntl_fork')) { + if ($useCli && function_exists('pcntl_fork') && function_exists('posix_setsid')) { $this->cli = true; } } @@ -193,7 +193,7 @@ class Sender $host = parse_url(get_unsafe_mttinfo('url'), PHP_URL_HOST); $host = preg_replace('/^(www\.)/', '', $host); //$host = gethostname(); - if (function_exists('posix_getuid') && false !== ($userinfo = posix_getpwuid(posix_getuid())) ) { + if (function_exists('posix_getpwuid') && false !== ($userinfo = posix_getpwuid(posix_getuid())) ) { return $userinfo['name']. '@'. $host; } return "mytinytodo@$host"; diff --git a/src/ext/notifications/cli-notify.php b/src/ext/notifications/cli-notify.php index 9dfc642..3bbee92 100644 --- a/src/ext/notifications/cli-notify.php +++ b/src/ext/notifications/cli-notify.php @@ -2,7 +2,7 @@ /* This file is a part of myTinyTodo. - (C) Copyright 2022 Max Pozdeev + (C) Copyright 2022-2023 Max Pozdeev Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details. */ @@ -16,6 +16,10 @@ if (!function_exists('pcntl_fork')) { error_log("Required PHP module is not found: pcntl"); exit(-2); } +if (!function_exists('posix_setsid')) { + error_log("Required PHP module is not found: posix"); + exit(-2); +} $dontStartSession = 1; require(__DIR__.'/../../init.php'); diff --git a/src/ext/notifications/extension.json b/src/ext/notifications/extension.json index 71bc31d..7101edb 100644 --- a/src/ext/notifications/extension.json +++ b/src/ext/notifications/extension.json @@ -1,6 +1,6 @@ { "bundleId": "notifications", "name": "Notifications", - "version": "1.1", + "version": "1.2", "description": "Notify about new tasks and lists on e-mail or telegram" }