Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117774798
D5661.1775241441.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D5661.1775241441.diff
View Options
diff --git a/src/app/Http/Controllers/API/SignupController.php b/src/app/Http/Controllers/API/SignupController.php
--- a/src/app/Http/Controllers/API/SignupController.php
+++ b/src/app/Http/Controllers/API/SignupController.php
@@ -88,7 +88,6 @@
public function init(Request $request): JsonResponse
{
// Don't allow URLs in user names preventing abuse of signup email
- // FIXME: I suppose we could also not use "Dear <user name>" in email
$name_validator = static function (string $attribute, mixed $value, \Closure $fail) {
if (str_contains($value, '://') || str_contains($value, '/')) {
$fail(self::trans('validation.invalidvalue'));
diff --git a/src/app/Mail/SignupVerification.php b/src/app/Mail/SignupVerification.php
--- a/src/app/Mail/SignupVerification.php
+++ b/src/app/Mail/SignupVerification.php
@@ -35,15 +35,8 @@
$this->code->tenant_id
);
- $username = $this->code->first_name ?? '';
- if (!empty($this->code->last_name)) {
- $username .= ' ' . $this->code->last_name;
- }
- $username = trim($username);
-
$vars = [
'site' => $appName,
- 'name' => $username ?: 'User',
];
$this->view('emails.html.signup_verification')
diff --git a/src/resources/lang/en/mail.php b/src/resources/lang/en/mail.php
--- a/src/resources/lang/en/mail.php
+++ b/src/resources/lang/en/mail.php
@@ -101,6 +101,7 @@
. ":site Support is here to help.",
'signupverification-subject' => ":site Registration",
+ 'signupverification-header' => "Hi,",
'signupverification-body1' => "This is your verification code for the :site registration process:",
'signupverification-body2' => "You can also click the link below to continue the registration process:",
diff --git a/src/resources/views/emails/html/signup_verification.blade.php b/src/resources/views/emails/html/signup_verification.blade.php
--- a/src/resources/views/emails/html/signup_verification.blade.php
+++ b/src/resources/views/emails/html/signup_verification.blade.php
@@ -4,7 +4,7 @@
<meta charset="utf-8">
</head>
<body>
- <p>{{ __('mail.header', $vars) }}</p>
+ <p>{{ __('mail.signupverification-header', $vars) }}</p>
<p>{{ __('mail.signupverification-body1', $vars) }}</p>
diff --git a/src/resources/views/emails/plain/signup_verification.blade.php b/src/resources/views/emails/plain/signup_verification.blade.php
--- a/src/resources/views/emails/plain/signup_verification.blade.php
+++ b/src/resources/views/emails/plain/signup_verification.blade.php
@@ -1,4 +1,4 @@
-{!! __('mail.header', $vars) !!}
+{!! __('mail.signupverification-header', $vars) !!}
{!! __('mail.signupverification-body1', $vars) !!}
diff --git a/src/tests/Unit/Mail/SignupVerificationTest.php b/src/tests/Unit/Mail/SignupVerificationTest.php
--- a/src/tests/Unit/Mail/SignupVerificationTest.php
+++ b/src/tests/Unit/Mail/SignupVerificationTest.php
@@ -35,9 +35,9 @@
$this->assertStringStartsWith('<!DOCTYPE html>', $html);
$this->assertTrue(strpos($html, $link) > 0);
- $this->assertTrue(strpos($html, 'First Last') > 0);
+ $this->assertStringContainsString('Hi', $html);
- $this->assertStringStartsWith('Dear First Last', $plain);
+ $this->assertStringStartsWith('Hi,', $plain);
$this->assertTrue(strpos($plain, $url) > 0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 6:37 PM (12 h, 46 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18825629
Default Alt Text
D5661.1775241441.diff (3 KB)
Attached To
Mode
D5661: Avoid including the name in the signup verification email as potential exploit path
Attached
Detach File
Event Timeline