aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarijus <mario@localhost.localdomain>2013-12-14 09:57:57 +0100
committermarijus <mario@localhost.localdomain>2013-12-14 09:57:57 +0100
commitc3c7a068332ae08aea5eeb8eaf820e34c9cf210b (patch)
tree91548f100a940632833648211ccb9893d0ca1042
parented5f725741455f9282a0dc38cd51b07e74b50ab1 (diff)
parenta4624d29791af75fea7907caa4c8cf7a1cca90a0 (diff)
downloadvolse-hubzilla-c3c7a068332ae08aea5eeb8eaf820e34c9cf210b.tar.gz
volse-hubzilla-c3c7a068332ae08aea5eeb8eaf820e34c9cf210b.tar.bz2
volse-hubzilla-c3c7a068332ae08aea5eeb8eaf820e34c9cf210b.zip
Merge branch 'master' of https://github.com/friendica/red
-rw-r--r--include/Contact.php13
-rw-r--r--include/photos.php12
-rwxr-xr-xinclude/text.php4
-rw-r--r--mod/photos.php5
4 files changed, 29 insertions, 5 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 5725e06f0..20dd04d17 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -77,6 +77,19 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') {
$a = get_app();
+ if(! $xchan) {
+ if($a->profile['channel_hash'])
+ $r = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($a->profile['channel_hash'])
+ );
+ if($r)
+ $xchan = $r[0];
+ }
+
+ if(! $xchan)
+ return;
+
+// FIXME - show connect button to observer if appropriate
$connect = false;
if(local_user()) {
$r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
diff --git a/include/photos.php b/include/photos.php
index ea4b494e0..9828140b8 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -279,8 +279,16 @@ function photos_album_widget($channelx,$observer,$albums = null) {
$o = '';
- if(! $albums)
- $albums = photos_albums_list($channelx,$observer);
+ // If we weren't passed an album list, see if the photos module
+ // dropped one for us to find in $a->data['albums'].
+ // If all else fails, load it.
+
+ if(! $albums) {
+ if(array_key_exists('albums', get_app()->data))
+ $albums = get_app()->data['albums'];
+ else
+ $albums = photos_albums_list($channelx,$observer);
+ }
if($albums) {
$o = replace_macros(get_markup_template('photo_albums.tpl'),array(
diff --git a/include/text.php b/include/text.php
index 042a972d1..f808fb0a0 100755
--- a/include/text.php
+++ b/include/text.php
@@ -1095,7 +1095,7 @@ function format_categories(&$item,$writeable) {
if($terms) {
$categories = array();
foreach($terms as $t) {
- $term = htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8') ;
+ $term = htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8',false) ;
if(! trim($term))
continue;
$removelink = (($writeable) ? z_root() . '/filerm/' . $item['id'] . '?f=&cat=' . urlencode($t['term']) : '');
@@ -1117,7 +1117,7 @@ function format_filer(&$item) {
if($terms) {
$categories = array();
foreach($terms as $t) {
- $term = htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8') ;
+ $term = htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8',false) ;
if(! trim($term))
continue;
$removelink = z_root() . '/filerm/' . $item['id'] . '?f=&term=' . urlencode($t['term']);
diff --git a/mod/photos.php b/mod/photos.php
index 64ca86941..0e23aa5bf 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -19,6 +19,9 @@ function photos_init(&$a) {
if(argc() > 1) {
$nick = argv(1);
+
+ profile_load($a,$nick);
+
$channelx = channelx_by_nick($nick);
if(! $channelx)
@@ -35,7 +38,7 @@ function photos_init(&$a) {
- $a->set_widget('vcard',vcard_from_xchan($a->data['channel'],$observer));
+ $a->set_widget('vcard',vcard_from_xchan('',$observer));
head_set_icon($a->data['channel']['xchan_photo_s']);
if($a->data['perms']['view_photos']) {
$a->data['albums'] = photos_albums_list($a->data['channel'],$observer);