Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More trivial updates #54

Merged
merged 5 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, который уже содержит функции этого расширения.',
iMattPro marked this conversation as resolved.
Show resolved Hide resolved
'PHPBB_VERSION_MIN_ERROR' => 'Это расширение несовместимо с вашей доской. Вы должны использовать phpBB версии 3.3.12 или новее.',
iMattPro marked this conversation as resolved.
Show resolved Hide resolved
'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
Loading