diff --git a/boot.php b/boot.php index 03a376165..218580a34 100644 --- a/boot.php +++ b/boot.php @@ -677,7 +677,7 @@ function check_url(App $a) // and www.example.com vs example.com. // We will only change the url to an ip address if there is no existing setting - if (empty($url) || (!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) { + if (empty($url) || (!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname()))) { Config::set('system', 'url', System::baseUrl()); } diff --git a/include/conversation.php b/include/conversation.php index de7a13626..21b700f2f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -405,7 +405,7 @@ function visible_activity($item) { * that are based on unique features of the calling module. * */ -function conversation(App $a, $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) { +function conversation(App $a, array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) { require_once 'mod/proxy.php'; $ssl_state = ((local_user()) ? true : false); @@ -768,7 +768,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order = * * @return array items with parents and comments */ -function conversation_add_children($parents, $block_authors, $order, $uid) { +function conversation_add_children(array $parents, $block_authors, $order, $uid) { $max_comments = Config::get('system', 'max_comments', 100); $params = ['order' => ['uid', 'commented' => true]]; diff --git a/include/items.php b/include/items.php index ab50e159a..e06df925e 100644 --- a/include/items.php +++ b/include/items.php @@ -429,9 +429,11 @@ function list_post_dates($uid, $wall) { $start_month = DateTimeFormat::utc($dstart, 'Y-m-d'); $end_month = DateTimeFormat::utc($dend, 'Y-m-d'); $str = day_translate(DateTimeFormat::utc($dnow, 'F')); + if (empty($ret[$dyear])) { $ret[$dyear] = []; } + $ret[$dyear][] = [$str, $end_month, $start_month]; $dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d'); } diff --git a/mod/network.php b/mod/network.php index 154332f7d..b2f6b7ba8 100644 --- a/mod/network.php +++ b/mod/network.php @@ -596,6 +596,7 @@ function networkThreadedView(App $a, $update, $parent) $sql_extra3 = ''; $sql_table = '`thread`'; $sql_parent = '`iid`'; + $sql_order = ''; if ($update) { $sql_table = '`item`'; diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 866065ec7..1f09b7cc8 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -24,6 +24,8 @@ use Friendica\Util\Network; use Friendica\Util\Temporal; use dba; +use InvalidArgumentException; + require_once 'include/dba.php'; require_once 'mod/proxy.php'; @@ -89,7 +91,7 @@ class Profile * @param array $profiledata array * @param boolean $show_connect Show connect link */ - public static function load(App $a, $nickname, $profile = 0, $profiledata = [], $show_connect = true) + public static function load(App $a, $nickname, $profile = 0, array $profiledata = [], $show_connect = true) { $user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]); @@ -100,11 +102,8 @@ class Profile return; } - if (empty($a->page['aside'])) { - $a->page['aside'] = ''; - } - - if ($profiledata) { + if (count($profiledata) > 0) { + // Add profile data to sidebar $a->page['aside'] .= self::sidebar($profiledata, true, $show_connect); if (!DBM::is_result($user)) {