wok rev 13155

zerobin: avoid some PHP notices
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jul 16 13:18:48 2012 +0200 (2012-07-16)
parents a6697022a666
children f967c9b8ac1a
files zerobin/stuff/zerobin.u
line diff
     1.1 --- a/zerobin/stuff/zerobin.u	Mon Jul 16 11:07:01 2012 +0200
     1.2 +++ b/zerobin/stuff/zerobin.u	Mon Jul 16 13:18:48 2012 +0200
     1.3 @@ -48,4 +48,27 @@
     1.4               if ($pngdata!='') $meta['vizhash'] = 'data:image/png;base64,'.base64_encode($pngdata);  
     1.5               // Once the avatar is generated, we do not keep the IP address, nor its hash.           
     1.6           }            
     1.7 +@@ -286,11 +293,11 @@
     1.8 +             if ($ERRORMESSAGE=='') // If no error, return the paste.
     1.9 +             {
    1.10 +                 // We kindly provide the remaining time before expiration (in seconds)
    1.11 +-                if ($paste->meta->expire_date) $paste->meta->remaining_time = $paste->meta->expire_date - time();
    1.12 ++                if (isset($paste->meta->expire_date)) $paste->meta->remaining_time = $paste->meta->expire_date - time();
    1.13 + 
    1.14 +                 $messages = array($paste); // The paste itself is the first in the list of encrypted messages.
    1.15 +                 // If it's a discussion, get all comments.
    1.16 +-                if ($paste->meta->opendiscussion)
    1.17 ++                if (isset($paste->meta->opendiscussion))
    1.18 +                 {
    1.19 +                     $comments=array();
    1.20 +                     $datadir = dataid2discussionpath($dataid);
    1.21 +@@ -318,7 +325,7 @@
    1.22 +                 $CIPHERDATA = json_encode($messages);
    1.23 +                 
    1.24 +                 // If the paste was meant to be read only once, delete it.
    1.25 +-                if ($paste->meta->burnafterreading) deletePaste($dataid);
    1.26 ++                if (isset($paste->meta->burnafterreading)) deletePaste($dataid);
    1.27 +             }
    1.28 +         }
    1.29 +         else
    1.30