Quick fix PHP notices in various files

- Remove unused variables
- Fix variable name typos
- Use x() and defaults() to fix undefined index
- Add back uninitialized variables
This commit is contained in:
Hypolite Petovan 2018-01-01 15:51:02 -05:00
commit 9f04017e27
9 changed files with 41 additions and 35 deletions

View file

@ -7,11 +7,11 @@ use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
require_once('include/items.php');
require_once('include/acl_selectors.php');
require_once('include/bbcode.php');
require_once('include/security.php');
require_once('include/redir.php');
require_once 'include/items.php';
require_once 'include/acl_selectors.php';
require_once 'include/bbcode.php';
require_once 'include/security.php';
require_once 'include/redir.php';
function videos_init(App $a) {
@ -44,12 +44,12 @@ function videos_init(App $a) {
$tpl = get_markup_template("vcard-widget.tpl");
$vcard_widget .= replace_macros($tpl, array(
$vcard_widget = replace_macros($tpl, array(
'$name' => $profile['name'],
'$photo' => $profile['photo'],
'$addr' => (($profile['addr'] != "") ? $profile['addr'] : ""),
'$addr' => defaults($profile, 'addr', ''),
'$account_type' => $account_type,
'$pdesc' => (($profile['pdesc'] != "") ? $profile['pdesc'] : ""),
'$pdesc' => defaults($profile, 'pdesc', ''),
));
@ -280,8 +280,9 @@ function videos_content(App $a) {
}
}
// perhaps they're visiting - but not a community page, so they wouldn't have write access
$groups = [];
// perhaps they're visiting - but not a community page, so they wouldn't have write access
if(remote_user() && (! $visitor)) {
$contact_id = 0;
if(is_array($_SESSION['remote'])) {
@ -317,7 +318,7 @@ function videos_content(App $a) {
return;
}
$sql_extra = permissions_sql($owner_uid,$remote_contact,$groups);
$sql_extra = permissions_sql($owner_uid, $remote_contact, $groups);
$o = "";