Skip to content

Commit 7ddd537

Browse files
committed
Added "5 minutes" and "1 week" expirations.
1 parent c7e1e15 commit 7ddd537

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

index.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function deletePaste($pasteid)
119119
data (mandatory) = json encoded SJCL encrypted text (containing keys: iv,salt,ct)
120120
121121
All optional data will go to meta information:
122-
expire (optional) = expiration delay (never,10min,1hour,1day,1month,1year,burn) (default:never)
122+
expire (optional) = expiration delay (never,5min,10min,1hour,1day,1week,1month,1year,burn) (default:never)
123123
opendiscusssion (optional) = is the discussion allowed on this paste ? (0/1) (default:0)
124124
syntaxcoloring (optional) = should this paste use syntax coloring when displaying.
125125
nickname (optional) = son encoded SJCL encrypted text nickname of author of comment (containing keys: iv,salt,ct)
@@ -157,9 +157,11 @@ function deletePaste($pasteid)
157157
if (!empty($_POST['expire']))
158158
{
159159
$expire=$_POST['expire'];
160-
if ($expire=='10min') $meta['expire_date']=time()+10*60;
160+
if ($expire=='5min') $meta['expire_date']=time()+5*60;
161+
elseif ($expire=='10min') $meta['expire_date']=time()+10*60;
161162
elseif ($expire=='1hour') $meta['expire_date']=time()+60*60;
162163
elseif ($expire=='1day') $meta['expire_date']=time()+24*60*60;
164+
elseif ($expire=='1week') $meta['expire_date']=time()+7*24*60*60;
163165
elseif ($expire=='1month') $meta['expire_date']=time()+30*24*60*60; // Well this is not *exactly* one month, it's 30 days.
164166
elseif ($expire=='1year') $meta['expire_date']=time()+365*24*60*60;
165167
elseif ($expire=='burn') $meta['burnafterreading']=true;

tpl/page.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ <h3>{$VERSION}</h3>
4848
<div id="expiration" style="display:none;">Expire:
4949
<select id="pasteExpiration" name="pasteExpiration">
5050
<option value="burn">Burn after reading</option>
51+
<option value="5min">5 minutes</option>
5152
<option value="10min">10 minutes</option>
5253
<option value="1hour">1 hour</option>
5354
<option value="1day">1 day</option>
55+
<option value="1week">1 week</option>
5456
<option value="1month" selected="selected">1 month</option>
5557
<option value="1year">1 year</option>
5658
<option value="never">Never</option>

0 commit comments

Comments
 (0)