Fix space name in membership confirmation (#5791)

* Fix space name in membership confirmation

* Fix user name in unfollow confirmation
This commit is contained in:
Yuriy Bakhtin 2022-07-05 14:34:03 +03:00 committed by GitHub
parent 3f4e8afeef
commit 67fa5b0d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -118,7 +118,7 @@ class FollowButton extends Widget
// Confirm action "Unfollow"
$this->unfollowOptions['data-action-confirm'] = Yii::t('SpaceModule.base', 'Would you like to unfollow Space {spaceName}?', [
'{spaceName}' => '<strong>' . $this->space->getDisplayName() . '</strong>'
'{spaceName}' => '<strong>' . Html::encode($this->space->getDisplayName()) . '</strong>'
]);
$module = Yii::$app->getModule('space');

View File

@ -12,6 +12,7 @@ use humhub\components\Widget;
use humhub\modules\space\models\Space;
use Yii;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Json;
/**
@ -84,7 +85,7 @@ class MembershipButton extends Widget
'attrs' => [
'data-action-click' => 'content.container.relationship',
'data-action-url' => $this->space->createUrl('/space/membership/revoke-membership'),
'data-action-confirm' => Yii::t('SpaceModule.base', 'Would you like to withdraw your request to join Space {spaceName}?', ['{spaceName}' => '<strong>' . $this->space->getDisplayName() . '</strong>']),
'data-action-confirm' => Yii::t('SpaceModule.base', 'Would you like to withdraw your request to join Space {spaceName}?', ['{spaceName}' => '<strong>' . Html::encode($this->space->getDisplayName()) . '</strong>']),
'data-button-options' => Json::encode($this->options),
'data-ui-loader' => '',
'class' => 'btn btn-info active',
@ -96,7 +97,7 @@ class MembershipButton extends Widget
'attrs' => [
'data-action-click' => 'content.container.relationship',
'data-action-url' => $this->space->createUrl('/space/membership/revoke-membership'),
'data-action-confirm' => Yii::t('SpaceModule.base', 'Would you like to end your membership in Space {spaceName}?', ['{spaceName}' => '<strong>' . $this->space->getDisplayName() . '</strong>']),
'data-action-confirm' => Yii::t('SpaceModule.base', 'Would you like to end your membership in Space {spaceName}?', ['{spaceName}' => '<strong>' . Html::encode($this->space->getDisplayName()) . '</strong>']),
'data-button-options' => Json::encode($this->options),
'data-ui-loader' => '',
'class' => 'btn btn-info active',

View File

@ -10,7 +10,6 @@ namespace humhub\modules\user\widgets;
use Yii;
use yii\bootstrap\Html;
use humhub\modules\friendship\models\Friendship;
/**
* UserFollowButton
@ -113,7 +112,7 @@ class UserFollowButton extends \yii\base\Widget
// Confirm action "Unfollow"
$this->unfollowOptions['data-action-confirm'] = Yii::t('SpaceModule.base', 'Would you like to unfollow {userName}?', [
'{userName}' => '<strong>' . $this->user->getDisplayName() . '</strong>'
'{userName}' => '<strong>' . Html::encode($this->user->getDisplayName()) . '</strong>'
]);
$module = Yii::$app->getModule('user');