mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-11 14:10:06 +01:00
Fix paste updated_at being updated when it should not be.
This commit is contained in:
parent
bc082581a9
commit
2aaa47ea25
4 changed files with 5 additions and 4 deletions
|
@ -16,6 +16,7 @@ class Paste extends Model {
|
|||
'visible' => 'integer',
|
||||
'encrypt' => 'boolean'
|
||||
];
|
||||
public $timestamps = false;
|
||||
|
||||
public function user() {
|
||||
return $this->belongsTo(User::class);
|
||||
|
|
|
@ -81,7 +81,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
|
||||
$error = validatePasteFields();
|
||||
|
||||
|
||||
if ($error !== null) {
|
||||
goto OutPut;
|
||||
}
|
||||
|
@ -93,7 +92,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
goto OutPut;
|
||||
}
|
||||
|
||||
$tags = Tag::parseTagInput($tag_input);
|
||||
$tags = Tag::parseTagInput($_POST['tag_input']);
|
||||
|
||||
if (count($tags) < 1) {
|
||||
$error = 'You must specify at least 1 tag.';
|
||||
|
@ -145,6 +144,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
'code' => $paste_code,
|
||||
'expiry' => $expires,
|
||||
'password' => $paste_password,
|
||||
'updated_at' => date_create(),
|
||||
'ip' => $ip
|
||||
]);
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
</div>
|
||||
</form>
|
||||
<?php // Registration page
|
||||
} elseif (isset($_GET['registeraccount'])) {
|
||||
} elseif (isset($_GET['register'])) {
|
||||
?>
|
||||
<form action="/register" method="post">
|
||||
<div class="columns">
|
||||
|
|
|
@ -127,7 +127,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
|||
Created: <?= $paste['created_at'] ?>
|
||||
<br/>
|
||||
<?php if ($paste['updated_at'] != $paste['created_at']): ?>
|
||||
<?= $paste['updated_at'] ?>
|
||||
Updated: <?= $paste['updated_at'] ?>
|
||||
<?php endif; ?>
|
||||
</small>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue