-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathadd.php
More file actions
executable file
·38 lines (31 loc) · 911 Bytes
/
add.php
File metadata and controls
executable file
·38 lines (31 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
* This file is part of Defuse Security's Secure Pastebin
* Find updates at: https://defuse.ca/pastebin.htm
* Developer contact: havoc AT defuse.ca
* This code is in the public domain. There is no warranty.
*/
require_once('pastebin.php');
delete_expired_posts();
if(isset($_POST['paste']))
{
//get the text
$data = smartslashes($_POST['paste']);
//Normalize the line endings
$data = str_replace("\r\n", "\n", $data);
$data = str_replace("\r", "\n", $data);
$urlKey = commit_post(
$data,
isset($_POST['jscrypt']) && $_POST['jscrypt'] == "yes",
(isset($_POST['lifetime']) ? (int)$_POST['lifetime'] : 3600*24*10),
isset($_POST['shorturl']) && $_POST['shorturl'] == "yes"
);
//redirect user to the view page
$http_host = $_SERVER['HTTP_HOST'];
header("Location: https://{$http_host}/b/{$urlKey}");
}
else
{
die("Empty post!");
}
?>