Compare commits

...

2 commits

Author SHA1 Message Date
218f229596
Default to 0.0.0.0 if IP header not found 2026-02-24 23:51:48 +00:00
bf38e8b731
Revert "use custom header for guestbook IP"
This reverts commit f58a3c9483.
2026-02-24 23:50:50 +00:00
3 changed files with 4 additions and 10 deletions

View file

@ -35,20 +35,14 @@ public function addEntry(Request $request): RedirectResponse {
->from(new Address("wah@wah.moe", "wah dot moe"))
->to(new Address("roscoe@wah.moe", "Roscoe D. Wah"))
->subject("New Guestbook Entry!")
->category("Guestbook entry")
->html('
<style> td { padding: 5px; vertical-align: top } </style>
<style> td { padding: 5px } </style>
<table border="1">
<tr><td><b>Name:</b></td><td>'.htmlentities($newEntry->name).'</td></tr>
<tr><td><b>IP:</b></td><td>'.$newEntry->ip.'</td></tr>
<tr><td><b>Agent:</b></td><td>'.htmlentities($newEntry->agent).'</td></tr>
<tr><td><b>Message:</b></td><td>'.htmlentities($newEntry->message).'</td></tr>
</table>')
->text('Name: '.htmlentities($newEntry->name).
'IP: '.$newEntry->ip.
'Agent: '.htmlentities($newEntry->agent).
'Message: '.htmlentities($newEntry->message)
);
</table>');
MailtrapClient::initSendingEmails(
apiKey: config('services.mailtrap-sdk.apiKey')

View file

@ -25,7 +25,7 @@ public static function create(Request $request): GuestbookEntry {
$newEntry = new GuestbookEntry;
$newEntry->name = $request->get('name');
$newEntry->message = $request->get('message');
$newEntry->ip = $request->header('X-Pandur-IP') ?: $request->ip();
$newEntry->ip = $request->header('X-Forwarded-For') ?: '0.0.0.0';
$newEntry->agent = $request->userAgent();
$newEntry->flagged = true;
$newEntry->save();

View file

@ -5,7 +5,7 @@
return [
'name' => env('APP_NAME', 'wah.moe'),
'version' => '2026.02.24',
'version' => '2026.02.24-patch0',
'env' => env('APP_ENV', 'production'),
'debug' => (bool)env('APP_DEBUG', false),
'url' => env('APP_URL', 'http://localhost'),