From b688dc3995a679fe58cfcc636806248026910d9d Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 23 Apr 2018 19:10:35 -0700 Subject: minor tweak to utf8 usernames after some testing of the underlying encode/decode funations. This probably isn't critical and I do not have a failure case but just trying to cover all bases. --- include/channel.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 4bf490bf0..42a392e8e 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2240,6 +2240,11 @@ function get_zcard_embed($channel, $observer_hash = '', $args = array()) { * - false if no channel with $nick was found */ function channelx_by_nick($nick) { + + // If we are provided a Unicode nickname convert to IDN + + $nick = punify($nick); + $r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' and channel_removed = 0 LIMIT 1", dbesc($nick) ); -- cgit v1.2.3 From 803e85caeb959c730fcb69135aa2ccd55bea751b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 14 May 2018 23:10:20 -0700 Subject: make get_default_profile_photo() pluggable --- include/channel.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 42a392e8e..1a62dcd3c 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1776,6 +1776,17 @@ function get_default_profile_photo($size = 300) { if(! $scheme) $scheme = 'rainbow_man'; + if(! is_dir('images/default_profile_photos/' . $scheme)) { + $x = [ 'scheme' => $scheme, 'size' => $size, 'url' => '' ]; + call_hooks('default_profile_photo',$x); + if($x['url']) { + return $x['url']; + } + else { + $scheme = 'rainbow_man'; + } + } + return 'images/default_profile_photos/' . $scheme . '/' . $size . '.png'; } -- cgit v1.2.3 From 6959c9e42350b7d19402bef24bb4fd366af22ed4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 10 Jun 2018 15:27:55 -0700 Subject: fixes for immediate expire, channel_active not initialised in DB --- include/channel.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 1a62dcd3c..d26056171 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2359,6 +2359,7 @@ function channel_store_lowlevel($arr) { 'channel_dirdate' => ((array_key_exists('channel_dirdate',$arr)) ? $arr['channel_dirdate'] : NULL_DATE), 'channel_lastpost' => ((array_key_exists('channel_lastpost',$arr)) ? $arr['channel_lastpost'] : NULL_DATE), 'channel_deleted' => ((array_key_exists('channel_deleted',$arr)) ? $arr['channel_deleted'] : NULL_DATE), + 'channel_active' => ((array_key_exists('channel_active',$arr)) ? $arr['channel_active'] : NULL_DATE), 'channel_max_anon_mail' => ((array_key_exists('channel_max_anon_mail',$arr)) ? $arr['channel_max_anon_mail'] : '10'), 'channel_max_friend_req' => ((array_key_exists('channel_max_friend_req',$arr)) ? $arr['channel_max_friend_req'] : '10'), 'channel_expire_days' => ((array_key_exists('channel_expire_days',$arr)) ? $arr['channel_expire_days'] : '0'), -- cgit v1.2.3 From 931afe98b13399342d5abb4cb13cb09efc09ecad Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 18 Jul 2018 17:05:38 -0700 Subject: mangled urls on redirects (cherry picked from commit 5ce50d0a2e15ae66765a68ba2785a87ecda57f6a) --- include/channel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index d26056171..59dd60ea2 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1712,7 +1712,7 @@ function zid_init() { $query = str_replace(array('?zid=','&zid='),array('?rzid=','&rzid='),$query); $dest = '/' . urlencode($query); if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) { - goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&owa=1&dest=' . z_root() . $dest); + goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&owa=1&bdest=' . bin2hex(z_root() . $dest)); } else logger('No hubloc found.'); -- cgit v1.2.3 From 67848c03edf02b8a6d3c2010f08d50d823685e27 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 18 Jul 2018 17:48:23 -0700 Subject: query filter was a bit greedy (cherry picked from commit a05c8ff66bd8d09f69f6c59bc49b7627792f4109) --- include/channel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 59dd60ea2..d7c5a2511 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1710,7 +1710,7 @@ function zid_init() { // try to avoid recursion - but send them home to do a proper magic auth $query = App::$query_string; $query = str_replace(array('?zid=','&zid='),array('?rzid=','&rzid='),$query); - $dest = '/' . urlencode($query); + $dest = '/' . $query; if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) { goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&owa=1&bdest=' . bin2hex(z_root() . $dest)); } -- cgit v1.2.3