|
|
@@ -191,15 +191,24 @@ class zerobin
|
|
|
// Read expiration date
|
|
|
if (!empty($_POST['expire']))
|
|
|
{
|
|
|
- if ($_POST['expire'] == 'burn') {
|
|
|
- $meta['burnafterreading'] = true;
|
|
|
- } elseif (array_key_exists($_POST['expire'], $this->_conf['expire_options'])) {
|
|
|
- $expire = $this->_conf['expire_options'][$_POST['expire']];
|
|
|
+ if (array_key_exists($_POST['expire'], $this->_conf['expire_options'])) {
|
|
|
+ $expire = $this->_conf['expire_options'][$_POST['expire']];
|
|
|
} else {
|
|
|
$expire = $this->_conf['expire_options'][$this->_conf['expire']['default']];
|
|
|
}
|
|
|
if ($expire > 0) $meta['expire_date'] = time() + $expire;
|
|
|
}
|
|
|
+
|
|
|
+ // Destroy the paste when it is read.
|
|
|
+ if (!empty($_POST['burnafterreading']))
|
|
|
+ {
|
|
|
+ $burnafterreading = $_POST['burnafterreading'];
|
|
|
+ if ($burnafterreading != '0')
|
|
|
+ {
|
|
|
+ if ($burnafterreading != '1') $error = true;
|
|
|
+ $meta['burnafterreading'] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// Read open discussion flag.
|
|
|
if ($this->_conf['main']['opendiscussion'] && !empty($_POST['opendiscussion']))
|
|
|
@@ -320,16 +329,16 @@ class zerobin
|
|
|
$this->_return_message(1, 'Server error.');
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Delete an existing paste
|
|
|
- *
|
|
|
- * @access private
|
|
|
+ /**
|
|
|
+ * Delete an existing paste
|
|
|
+ *
|
|
|
+ * @access private
|
|
|
* @param string $dataid
|
|
|
* @param string $deletetoken
|
|
|
- * @return void
|
|
|
- */
|
|
|
- private function _delete($dataid, $deletetoken)
|
|
|
- {
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ private function _delete($dataid, $deletetoken)
|
|
|
+ {
|
|
|
// Is this a valid paste identifier?
|
|
|
if (preg_match('\A[a-f\d]{16}\z', $dataid))
|
|
|
{
|
|
|
@@ -428,12 +437,12 @@ class zerobin
|
|
|
private function _view()
|
|
|
{
|
|
|
// set headers to disable caching
|
|
|
- $time = gmdate('D, d M Y H:i:s \G\M\T');
|
|
|
- header('Cache-Control: no-store, no-cache, must-revalidate');
|
|
|
- header('Pragma: no-cache');
|
|
|
- header('Expires: ' . $time);
|
|
|
- header('Last-Modified: ' . $time);
|
|
|
- header('Vary: Accept');
|
|
|
+ $time = gmdate('D, d M Y H:i:s \G\M\T');
|
|
|
+ header('Cache-Control: no-store, no-cache, must-revalidate');
|
|
|
+ header('Pragma: no-cache');
|
|
|
+ header('Expires: ' . $time);
|
|
|
+ header('Last-Modified: ' . $time);
|
|
|
+ header('Vary: Accept');
|
|
|
|
|
|
// label all the expiration options
|
|
|
$expire = array();
|