diff --git a/index.php b/index.php index 270309e..0ced6e9 100644 --- a/index.php +++ b/index.php @@ -206,7 +206,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $error = $lang['loginwarning']; //"You must be logged in to do that." } } else { + if ($current_user['id'] == NULL) { + $paste_owner = "1"; + }else{ $paste_owner = $current_user ? $current_user['id'] : null; + } $statement = $conn->prepare( "INSERT INTO pastes (title, content, visible, code, expiry, password, encrypt, user_id, created_at, ip, views, tagsys) VALUES (?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?, 0, ?)"