Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion core/lexicon/en/setting.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@

$_lang['setting_signupemail_message'] = 'Sign-up email';
$_lang['setting_signupemail_message_desc'] = 'Here you can set the message sent to your users when you create an account for them and let MODX send them an email containing their username and password. <br /><strong>Note:</strong> The following placeholders are replaced by the Content Manager when the message is sent: <br /><br />[[+sname]] - Name of your web site, <br />[[+saddr]] - Your web site email address, <br />[[+surl]] - Your site URL, <br />[[+uid]] - User\'s login name or id, <br />[[+pwd]] - User\'s password, <br />[[+ufn]] - User\'s full name. <br /><br /><strong>Leave the [[+uid]] and [[+pwd]] in the email, or else the username and password won\'t be sent in the mail and your users won\'t know their username or password!</strong>';
$_lang['setting_signupemail_message_default'] = 'Hello [[+uid]] \n\nHere are your login details for [[+sname]] Content Manager:\n\nUsername: [[+uid]]\nPassword: [[+pwd]]\n\nOnce you log into the Content Manager ([[+surl]]), you can change your password.\n\nRegards,\nSite Administrator';
$_lang['setting_signupemail_message_default'] = 'Hello [[+uid]] \n\nHere are your login details for [[+sname]] Content Manager:\n\nUsername: [[+uid]]\nPassword: [[+pwd]]\n\nOnce you log into the Content Manager at <a href="[[+surl]]">[[+surl]]</a>, you can change your password.\n\nRegards,\nSite Administrator';

$_lang['setting_site_name'] = 'Site name';
$_lang['setting_site_name_desc'] = 'Enter the name of your site here.';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

/**
* Wrap [[+surl]] in signupemail_message so mail clients do not autolink
* trailing punctuation into the manager URL.
*
* @see https://github.com/modxcms/revolution/issues/15209
*
* @var modX $modx
* @package setup
* @subpackage upgrades
*/

use MODX\Revolution\modSystemSetting;

/** @var modSystemSetting|null $setting */
$setting = $modx->getObject(modSystemSetting::class, [
'key' => 'signupemail_message',
]);
if (!$setting instanceof modSystemSetting) {
return;
}

$value = $setting->get('value');
if (!is_string($value) || $value === '' || strpos($value, '[[+surl]]') === false) {
return;
}

if (
stripos($value, 'href="[[+surl]]"') !== false
|| stripos($value, "href='[[+surl]]'") !== false
) {
return;
}

$link = '<a href="[[+surl]]">[[+surl]]</a>';
$token = "\0SURL_LINK\0";

$updated = str_replace('([[+surl]])', $token, $value);
$updated = str_replace('([[+surl]])', $token, $updated);
$updated = str_replace('[[+surl]]', $token, $updated);
$updated = str_replace($token, $link, $updated);

if ($updated === $value) {
return;
}

$setting->set('value', $updated);
$setting->save();
13 changes: 13 additions & 0 deletions setup/includes/upgrades/mysql/3.3.0-pl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* Specific upgrades for Revolution 3.3.0-pl
*
* @var modX $modx
* @var modInstallVersion $this
* @package setup
* @subpackage upgrades
*/

/* run upgrades common to all db platforms */
include dirname(__DIR__) . '/common/3.3.0-update-sys-setting_signupemail_message.php';
Loading