diff --git a/public/index.php b/public/index.php index d21ec45..38ae4ae 100644 --- a/public/index.php +++ b/public/index.php @@ -126,11 +126,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $paste_password = password_hash($paste_password, PASSWORD_DEFAULT); } - $paste_content = openssl_encrypt( - $_POST['paste_data'], - PP_ENCRYPTION_ALGO, - PP_ENCRYPTION_KEY - ); + // If it's a new paste or the existing paste is encrypted, encrypt the paste + // This is to prevent legacy pastes from getting weird + if ($editing && !$paste->encrypt) { + $paste_content = $_POST['paste_data']; + } else { + $paste_content = openssl_encrypt( + $_POST['paste_data'], + PP_ENCRYPTION_ALGO, + PP_ENCRYPTION_KEY + ); + } // Set expiry time $expires = calculatePasteExpiry($p_expiry); diff --git a/theme/bulma/main.php b/theme/bulma/main.php index 6a47dd7..d525cde 100644 --- a/theme/bulma/main.php +++ b/theme/bulma/main.php @@ -61,7 +61,7 @@ + placeholder="Paste or drop text file here.">
File Size: 1000/1000Kb