Delete temp files properly when X-Face does not produce an image
This commit is contained in:
parent
dbf2f4e63d
commit
4fabc09dca
@ -624,6 +624,7 @@ function message_show($group,$id,$attachment=0,$article_data=false,$maxlen=false
|
|||||||
show_header($head,$group,$local_poster);
|
show_header($head,$group,$local_poster);
|
||||||
// X-Face
|
// X-Face
|
||||||
if ($face = display_full_headers($head->number,$group,$head->name,$head->from,true)) {
|
if ($face = display_full_headers($head->number,$group,$head->name,$head->from,true)) {
|
||||||
|
// $pngfile = '../tmp/face-'.preg_replace("/[^A-Za-z0-9 ]/", '', $head->id);
|
||||||
$pngfile = '../tmp/face-'.hash('ripemd160', $face);
|
$pngfile = '../tmp/face-'.hash('ripemd160', $face);
|
||||||
if(file_exists($pngfile)) {
|
if(file_exists($pngfile)) {
|
||||||
echo '<img align="right" src="'.$pngfile.'">';
|
echo '<img align="right" src="'.$pngfile.'">';
|
||||||
@ -637,11 +638,11 @@ function message_show($group,$id,$attachment=0,$article_data=false,$maxlen=false
|
|||||||
imagepng($xbm, $pngfile);
|
imagepng($xbm, $pngfile);
|
||||||
imagedestroy($xbm);
|
imagedestroy($xbm);
|
||||||
echo '<img align="right" src="'.$pngfile.'">';
|
echo '<img align="right" src="'.$pngfile.'">';
|
||||||
|
}
|
||||||
unlink($facefile);
|
unlink($facefile);
|
||||||
unlink($xbmfile);
|
unlink($xbmfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//RSLIGHT Encryption
|
//RSLIGHT Encryption
|
||||||
$encrypted=false;
|
$encrypted=false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user