make new os_storage flag work

This commit is contained in:
redmatrix 2015-06-14 15:59:11 -07:00
parent b7be79c5e7
commit 23f7f60bf7
2 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,7 @@ function attach_init(&$a) {
}
header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
if($r['data']['flags'] & ATTACH_FLAG_OS ) {
if(intval($r['data']['os_storage'])) {
$fname = dbunescbin($r['data']['data']);
$istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb');
$ostream = fopen('php://output','wb');

View File

@ -69,6 +69,8 @@ function photo_init(&$a) {
$data = dbunescbin($r[0]['data']);
$mimetype = $r[0]['type'];
}
if(intval($r[0]['os_storage']))
$data = file_get_contents($data);
if(! isset($data)) {
$data = file_get_contents($default);
$mimetype = 'image/png';
@ -142,6 +144,8 @@ function photo_init(&$a) {
if($r && $allowed) {
$data = dbunescbin($r[0]['data']);
$mimetype = $r[0]['type'];
if(intval($r[0]['os_storage']))
$data = file_get_contents($data);
}
else {