# HG changeset patch # User Pascal Bellard # Date 1342437528 -7200 # Node ID 37066c5660837b39ad907acadb265582b2ca439c # Parent a6697022a666ef2faa85aaa8adfb1e9883a5ce62 zerobin: avoid some PHP notices diff -r a6697022a666 -r 37066c566083 zerobin/stuff/zerobin.u --- a/zerobin/stuff/zerobin.u Mon Jul 16 11:07:01 2012 +0200 +++ b/zerobin/stuff/zerobin.u Mon Jul 16 13:18:48 2012 +0200 @@ -48,4 +48,27 @@ if ($pngdata!='') $meta['vizhash'] = 'data:image/png;base64,'.base64_encode($pngdata); // Once the avatar is generated, we do not keep the IP address, nor its hash. } +@@ -286,11 +293,11 @@ + if ($ERRORMESSAGE=='') // If no error, return the paste. + { + // We kindly provide the remaining time before expiration (in seconds) +- if ($paste->meta->expire_date) $paste->meta->remaining_time = $paste->meta->expire_date - time(); ++ if (isset($paste->meta->expire_date)) $paste->meta->remaining_time = $paste->meta->expire_date - time(); + + $messages = array($paste); // The paste itself is the first in the list of encrypted messages. + // If it's a discussion, get all comments. +- if ($paste->meta->opendiscussion) ++ if (isset($paste->meta->opendiscussion)) + { + $comments=array(); + $datadir = dataid2discussionpath($dataid); +@@ -318,7 +325,7 @@ + $CIPHERDATA = json_encode($messages); + + // If the paste was meant to be read only once, delete it. +- if ($paste->meta->burnafterreading) deletePaste($dataid); ++ if (isset($paste->meta->burnafterreading)) deletePaste($dataid); + } + } + else