mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +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',
|
'visible' => 'integer',
|
||||||
'encrypt' => 'boolean'
|
'encrypt' => 'boolean'
|
||||||
];
|
];
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
public function user() {
|
public function user() {
|
||||||
return $this->belongsTo(User::class);
|
return $this->belongsTo(User::class);
|
||||||
|
|
|
@ -81,7 +81,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
|
||||||
$error = validatePasteFields();
|
$error = validatePasteFields();
|
||||||
|
|
||||||
|
|
||||||
if ($error !== null) {
|
if ($error !== null) {
|
||||||
goto OutPut;
|
goto OutPut;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +92,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
goto OutPut;
|
goto OutPut;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tags = Tag::parseTagInput($tag_input);
|
$tags = Tag::parseTagInput($_POST['tag_input']);
|
||||||
|
|
||||||
if (count($tags) < 1) {
|
if (count($tags) < 1) {
|
||||||
$error = 'You must specify at least 1 tag.';
|
$error = 'You must specify at least 1 tag.';
|
||||||
|
@ -145,6 +144,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
'code' => $paste_code,
|
'code' => $paste_code,
|
||||||
'expiry' => $expires,
|
'expiry' => $expires,
|
||||||
'password' => $paste_password,
|
'password' => $paste_password,
|
||||||
|
'updated_at' => date_create(),
|
||||||
'ip' => $ip
|
'ip' => $ip
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<?php // Registration page
|
<?php // Registration page
|
||||||
} elseif (isset($_GET['registeraccount'])) {
|
} elseif (isset($_GET['register'])) {
|
||||||
?>
|
?>
|
||||||
<form action="/register" method="post">
|
<form action="/register" method="post">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
|
|
|
@ -127,7 +127,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
Created: <?= $paste['created_at'] ?>
|
Created: <?= $paste['created_at'] ?>
|
||||||
<br/>
|
<br/>
|
||||||
<?php if ($paste['updated_at'] != $paste['created_at']): ?>
|
<?php if ($paste['updated_at'] != $paste['created_at']): ?>
|
||||||
<?= $paste['updated_at'] ?>
|
Updated: <?= $paste['updated_at'] ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue