mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-11 14:10:06 +01:00
fix: disable password pastes completely
This commit is contained in:
parent
c7eadd4b0c
commit
c42b22123e
3 changed files with 0 additions and 33 deletions
|
@ -115,24 +115,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
$paste_content = $_POST['paste_data'];
|
||||
$paste_visibility = $_POST['visibility'];
|
||||
$paste_code = $_POST['format'] ?? 'green';
|
||||
$paste_password = $_POST['pass'];
|
||||
$tag_input = $_POST['tag_input'];
|
||||
|
||||
if (!in_array($paste_code, PP_HIGHLIGHT_FORMATS)) {
|
||||
$paste_code = 'green';
|
||||
}
|
||||
|
||||
if (!empty($paste_password) && $editing) {
|
||||
if (!$current_user) {
|
||||
$error = 'You must be logged in to create a password-protected paste.';
|
||||
goto OutPut;
|
||||
}
|
||||
|
||||
// $paste_password = password_hash($paste_password, PASSWORD_DEFAULT);
|
||||
} else {
|
||||
$paste_password = null;
|
||||
}
|
||||
|
||||
$paste_content = openssl_encrypt(
|
||||
$_POST['paste_data'],
|
||||
PP_ENCRYPTION_ALGO,
|
||||
|
@ -152,7 +140,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
'visible' => $paste_visibility,
|
||||
'code' => $paste_code,
|
||||
'expiry' => $expires,
|
||||
'password' => $paste_password,
|
||||
'updated_at' => date_create(),
|
||||
'ip' => $ip,
|
||||
'encrypt' => true
|
||||
|
@ -171,7 +158,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
'content' => $paste_content,
|
||||
'visible' => $paste_visibility,
|
||||
'expiry' => $expires,
|
||||
'password' => $paste_password,
|
||||
'encrypt' => true,
|
||||
'created_at' => date_create(),
|
||||
'ip' => $ip
|
||||
|
|
|
@ -137,14 +137,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="field">
|
||||
<div class="control">
|
||||
<input type="text" class="input pp-width-auto" name="pass" id="pass"
|
||||
placeholder="Password (optional)<?= $current_user ? ' (must be logged in)': '' ?>" autocomplete="new-password"<?= $current_user ? '' : ' disabled="disabled"' ?>
|
||||
value="<?php echo (isset($_POST['pass'])) ? pp_html_escape($_POST['pass']) : ''; ?>"/>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input class="is-checkradio is-info has-background-color" id="encrypt"
|
||||
|
|
|
@ -306,17 +306,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<nav>
|
||||
<div class="level-left">
|
||||
<!-- Password -->
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<input type="text" class="input" name="pass" id="pass" value=""
|
||||
placeholder="Password" autocomplete="new-password"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<br>
|
||||
<div class="level-left">
|
||||
<!-- Encrypted -->
|
||||
|
|
Loading…
Add table
Reference in a new issue