Skip to content

Commit

Permalink
Merge pull request #54 from iMattPro/trivial
Browse files Browse the repository at this point in the history
More trivial updates
  • Loading branch information
iMattPro authored Jun 9, 2024
2 parents c5df91e + 20ba528 commit 163d1c5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
10 changes: 7 additions & 3 deletions ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ public function is_enableable()
*/
protected function check_phpbb_version()
{
if (phpbb_version_compare(PHPBB_VERSION, '3.3.12-dev', '<') ||
phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '>='))
if (phpbb_version_compare(PHPBB_VERSION, '3.3.12', '<'))
{
$this->errors[] = 'PHPBB_VERSION_ERROR';
$this->errors[] = 'PHPBB_VERSION_MIN_ERROR';
}

if (phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '>='))
{
$this->errors[] = 'PHPBB_VERSION_MAX_ERROR';
}

return $this;
Expand Down
5 changes: 3 additions & 2 deletions language/en/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
//

$lang = array_merge($lang, [
'PHPBB_VERSION_ERROR' => 'This extension is not compatible with your board. You must be using phpBB 3.3.12 or newer, up to but not including phpBB 4.x.x.',
'PHP_VERSION_ERROR' => 'This extension is not compatible with your server. Your server must be running PHP 7.3 or newer.',
'PHPBB_VERSION_MAX_ERROR' => 'This extension can not be installed on your board. You are using phpBB 4, which already contains the features in this extension.',
'PHPBB_VERSION_MIN_ERROR' => 'This extension is not compatible with your board. You must be using phpBB 3.3.12 or newer.',
'PHP_VERSION_ERROR' => 'This extension is not compatible with your server. Your server must be running PHP 7.3 or newer.',
]);
5 changes: 3 additions & 2 deletions language/ru/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
//

$lang = array_merge($lang, [
'PHPBB_VERSION_ERROR' => 'Данное расширение несовместимо с установленной версией конференции. Необходима версия phpBB 3.3.12 или выше, за исключением phpBB 4.x.x.',
'PHP_VERSION_ERROR' => 'Данное расширение несовместимо с установленной на сервере версией PHP. Необходима версия PHP 7.3 или выше.',
'PHPBB_VERSION_MAX_ERROR' => 'Данное расширение несовместимо с установленной версией конференции. Вы используете версию phpBB 4, которая уже содержит соответствующие функции.',
'PHPBB_VERSION_MIN_ERROR' => 'Данное расширение несовместимо с установленной версией конференции. Необходима версия phpBB 3.3.12 или выше.',
'PHP_VERSION_ERROR' => 'Данное расширение несовместимо с установленной на сервере версией PHP. Необходима версия PHP 7.3 или выше.',
]);
4 changes: 2 additions & 2 deletions notification/method/webpush.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class webpush extends messenger_base implements extended_method_interface
protected $push_subscriptions_table;

/** @var int Fallback size for padding if endpoint is mozilla, see https://github.com/web-push-libs/web-push-php/issues/108#issuecomment-2133477054 */
const MOZILLA_FALLBACK_PADDING = 2820;
public const MOZILLA_FALLBACK_PADDING = 2820;

/**
* Notification Method Web Push constructor
Expand Down Expand Up @@ -216,7 +216,7 @@ protected function notify_using_webpush(): void

$user_subscriptions = $user_subscription_map[$notification->user_id] ?? [];

if ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL
if (($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL)
|| empty($user_subscriptions))
{
continue;
Expand Down

0 comments on commit 163d1c5

Please sign in to comment.