aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-07 16:02:56 -0700
committerfriendica <info@friendica.com>2012-06-07 16:02:56 -0700
commitba2452a076c0635e94c6a0967b778df0df14eca7 (patch)
tree2fd57e8f38a29bb98c2f85502f9db214b29b34f9
parent67d8afb9d18df137fddc991443f9b796b5821210 (diff)
downloadvolse-hubzilla-ba2452a076c0635e94c6a0967b778df0df14eca7.tar.gz
volse-hubzilla-ba2452a076c0635e94c6a0967b778df0df14eca7.tar.bz2
volse-hubzilla-ba2452a076c0635e94c6a0967b778df0df14eca7.zip
png support for embedded private photos
-rwxr-xr-xinclude/items.php4
-rw-r--r--mod/msearch.php2
-rw-r--r--mod/photo.php2
3 files changed, 4 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php
index 15c043e92..fc6819738 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2952,7 +2952,7 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
if(stristr($image , $site . '/photo/')) {
$replace = false;
$i = basename($image);
- $i = str_replace('.jpg','',$i);
+ $i = str_replace(array('.jpg','.png'),array('',''),$i);
$x = strpos($i,'-');
if($x) {
$res = substr($i,$x+1);
@@ -2994,7 +2994,7 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
}
if($replace) {
logger('fix_private_photos: replacing photo', LOGGER_DEBUG);
- $s = str_replace($image, 'data:image/jpg;base64,' . base64_encode($r[0]['data']), $s);
+ $s = str_replace($image, 'data:' . $r[0]['type'] . ';base64,' . base64_encode($r[0]['data']), $s);
logger('fix_private_photos: replaced: ' . $s, LOGGER_DATA);
}
}
diff --git a/mod/msearch.php b/mod/msearch.php
index 94def7d89..89de5b705 100644
--- a/mod/msearch.php
+++ b/mod/msearch.php
@@ -28,7 +28,7 @@ function msearch_post(&$a) {
$results[] = array(
'name' => $rr['name'],
'url' => $a->get_baseurl() . '/profile/' . $rr['nickname'],
- 'photo' => $a->get_baseurl() . '/photo/avatar/' . $rr['uid'] . 'jpg',
+ 'photo' => $a->get_baseurl() . '/photo/avatar/' . $rr['uid'] . '.jpg',
'tags' => str_replace(array(',',' '),array(' ',' '),$rr['pub_keywords'])
);
}
diff --git a/mod/photo.php b/mod/photo.php
index e8e74cfde..dee483d83 100644
--- a/mod/photo.php
+++ b/mod/photo.php
@@ -76,7 +76,7 @@ function photo_init(&$a) {
break;
}
- $uid = str_replace('.jpg', '', $person);
+ $uid = str_replace(array('.jpg','.png'),array('',''), $person);
$r = q("SELECT * FROM `photo` WHERE `scale` = %d AND `uid` = %d AND `profile` = 1 LIMIT 1",
intval($resolution),