Fixes for some E_NOTICE and type-hints added (#5358)

* Fixed http://github to https://github

Signed-off-by: Roland Häder <roland@mxchange.org>

* Fixes for #4965:
- updated messages.po file

Signed-off-by: Roland Häder <roland@mxchange.org>

* Fixed E_NOTICE where isset()/empty() was absent.

Signed-off-by: Roland Häder <roland@mxchange.org>

* Fixed missing variable $sql_order causing E_NOTICE.

Signed-off-by: Roland Häder <roland@mxchange.org>

* Continued:
- added array type-hint where known (some)

Signed-off-by: Roland Häder <roland@mxchange.org>

* Fixes:
- in Profile::load() $user is now only one-dimensional
- $a->get_hostname is no property, it is a method

Signed-off-by: Roland Häder <roland@mxchange.org>

* reverted changes that are unintended

Signed-off-by: Roland Häder <roland@mxchange.org>

* Continued:
- removed leading \ (uncommon, okay)
- removed entire if() block (CR by Hypolite)

Signed-off-by: Roland Häder <roland@mxchange.org>

* Removed if() block

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2018-07-13 21:47:14 +02:00 committed by Hypolite Petovan
parent 30cef1a739
commit 6b5d90333f
5 changed files with 11 additions and 9 deletions

View File

@ -677,7 +677,7 @@ function check_url(App $a)
// and www.example.com vs example.com. // and www.example.com vs example.com.
// We will only change the url to an ip address if there is no existing setting // 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()); Config::set('system', 'url', System::baseUrl());
} }

View File

@ -405,7 +405,7 @@ function visible_activity($item) {
* that are based on unique features of the calling module. * 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'; require_once 'mod/proxy.php';
$ssl_state = ((local_user()) ? true : false); $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 * @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); $max_comments = Config::get('system', 'max_comments', 100);
$params = ['order' => ['uid', 'commented' => true]]; $params = ['order' => ['uid', 'commented' => true]];

View File

@ -429,9 +429,11 @@ function list_post_dates($uid, $wall) {
$start_month = DateTimeFormat::utc($dstart, 'Y-m-d'); $start_month = DateTimeFormat::utc($dstart, 'Y-m-d');
$end_month = DateTimeFormat::utc($dend, 'Y-m-d'); $end_month = DateTimeFormat::utc($dend, 'Y-m-d');
$str = day_translate(DateTimeFormat::utc($dnow, 'F')); $str = day_translate(DateTimeFormat::utc($dnow, 'F'));
if (empty($ret[$dyear])) { if (empty($ret[$dyear])) {
$ret[$dyear] = []; $ret[$dyear] = [];
} }
$ret[$dyear][] = [$str, $end_month, $start_month]; $ret[$dyear][] = [$str, $end_month, $start_month];
$dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d'); $dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d');
} }

View File

@ -596,6 +596,7 @@ function networkThreadedView(App $a, $update, $parent)
$sql_extra3 = ''; $sql_extra3 = '';
$sql_table = '`thread`'; $sql_table = '`thread`';
$sql_parent = '`iid`'; $sql_parent = '`iid`';
$sql_order = '';
if ($update) { if ($update) {
$sql_table = '`item`'; $sql_table = '`item`';

View File

@ -24,6 +24,8 @@ use Friendica\Util\Network;
use Friendica\Util\Temporal; use Friendica\Util\Temporal;
use dba; use dba;
use InvalidArgumentException;
require_once 'include/dba.php'; require_once 'include/dba.php';
require_once 'mod/proxy.php'; require_once 'mod/proxy.php';
@ -89,7 +91,7 @@ class Profile
* @param array $profiledata array * @param array $profiledata array
* @param boolean $show_connect Show connect link * @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]); $user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
@ -100,11 +102,8 @@ class Profile
return; return;
} }
if (empty($a->page['aside'])) { if (count($profiledata) > 0) {
$a->page['aside'] = ''; // Add profile data to sidebar
}
if ($profiledata) {
$a->page['aside'] .= self::sidebar($profiledata, true, $show_connect); $a->page['aside'] .= self::sidebar($profiledata, true, $show_connect);
if (!DBM::is_result($user)) { if (!DBM::is_result($user)) {