need to perform dbunescbin on stored filenames as well as binary data - this is a no-op under mysql but could provide unpredictable data under postgres
This commit is contained in:
parent
547c700764
commit
5c891bcfb5
@ -88,7 +88,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
||||
if($r) {
|
||||
|
||||
$base_image = $r[0];
|
||||
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents($base_image['content']) : dbunescbin($base_image['content']));
|
||||
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content']));
|
||||
|
||||
$im = photo_factory($base_image['content'], $base_image['mimetype']);
|
||||
if($im->is_valid()) {
|
||||
@ -320,7 +320,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if(intval($r[0]['os_storage']))
|
||||
$data = @file_get_contents($r[0]['content']);
|
||||
$data = @file_get_contents(dbunescbin($r[0]['content']));
|
||||
else
|
||||
$data = dbunescbin($r[0]['content']);
|
||||
|
||||
|
@ -246,7 +246,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
$d = (($r[0]['os_storage']) ? @file_get_contents($r[0]['content']) : dbunescbin($r[0]['content']));
|
||||
$d = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($r[0]['content'])) : dbunescbin($r[0]['content']));
|
||||
$ph = photo_factory($d, $r[0]['mimetype']);
|
||||
if($ph->is_valid()) {
|
||||
$rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 );
|
||||
|
@ -98,7 +98,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
|
||||
if($r) {
|
||||
|
||||
$base_image = $r[0];
|
||||
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents($base_image['content']) : dbunescbin($base_image['content']));
|
||||
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content']));
|
||||
|
||||
$im = photo_factory($base_image['content'], $base_image['mimetype']);
|
||||
if($im->is_valid()) {
|
||||
@ -354,7 +354,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if(intval($r[0]['os_storage']))
|
||||
$data = @file_get_contents($r[0]['content']);
|
||||
$data = @file_get_contents(dbunescbin($r[0]['content']));
|
||||
else
|
||||
$data = dbunescbin($r[0]['content']);
|
||||
|
||||
|
Reference in New Issue
Block a user