Partial fixes

This commit is contained in:
Frankie B 2023-07-29 17:15:39 +01:00
commit eabff07f08
No known key found for this signature in database
8 changed files with 13 additions and 344 deletions

View file

@ -18,17 +18,20 @@ public function guestbookPost(Request $request) {
$matching_bans = DB::select('SELECT reason FROM guestbook__bans WHERE ip_address = ?', array($request->ip()));
if (count($matching_bans) > 0 ) {
if (!empty($matching_bans)) {
return view('errors.guestbook-ipban')->with('reason', $matching_bans[0]->reason);
}
DB::insert('INSERT INTO guestbook__entries (name, timestamp, ip_address, agent, message) values (?, ?, ?, ?, ?)', array(
htmlspecialchars($request->get('name')),
time(),
$request->ip(),
$request->userAgent(),
htmlspecialchars($request->get('message'))
));
DB::insert(
'INSERT INTO guestbook__entries (name, timestamp, ip_address, agent, message) values (?, ?, ?, ?, ?)',
array(
htmlspecialchars($request->get('name')),
time(),
$request->ip(),
$request->userAgent(),
htmlspecialchars($request->get('message'))
)
);
return back()->with('success', 'Entry submitted successfully!');
}