1
0
Fork 0

Merge pull request #4440 from rabuzarus/20180211_-_fix_variables_part_two

fix undeclared variables or wrong variable names (/mod) part 2
This commit is contained in:
Hypolite Petovan 2018-02-12 19:53:39 -05:00 committed by GitHub
commit 724a58e79a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 42 additions and 36 deletions

View file

@ -168,7 +168,7 @@ function dfrn_request_post(App $a)
$parms['key'] // this was already escaped $parms['key'] // this was already escaped
); );
if (DBM::is_result($r)) { if (DBM::is_result($r)) {
Group::addMember(User::getDefaultGroup($uid, $r[0]["network"]), $r[0]['id']); Group::addMember(User::getDefaultGroup(local_user(), $r[0]["network"]), $r[0]['id']);
if (isset($photo)) { if (isset($photo)) {
Contact::updateAvatar($photo, local_user(), $r[0]["id"], true); Contact::updateAvatar($photo, local_user(), $r[0]["id"], true);

View file

@ -38,6 +38,8 @@ function editpost_content(App $a) {
return; return;
} }
$geotag = '';
$o .= replace_macros(get_markup_template("section_title.tpl"),[ $o .= replace_macros(get_markup_template("section_title.tpl"),[
'$title' => L10n::t('Edit post') '$title' => L10n::t('Edit post')
]); ]);
@ -61,10 +63,11 @@ function editpost_content(App $a) {
$tpl = get_markup_template("jot.tpl"); $tpl = get_markup_template("jot.tpl");
if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) if (strlen($itm['allow_cid']) || strlen($itm['allow_gid']) || strlen($itm['deny_cid']) || strlen($itm['deny_gid'])) {
$lockstate = 'lock'; $lockstate = 'lock';
else } else {
$lockstate = 'unlock'; $lockstate = 'unlock';
}
$jotplugins = ''; $jotplugins = '';
$jotnets = ''; $jotnets = '';
@ -140,7 +143,7 @@ function editpost_content(App $a) {
'$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'), '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate, '$lockstate' => $lockstate,
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)), '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
'$bang' => (($group) ? '!' : ''), '$bang' => ($lockstate === 'lock' ? '!' : ''),
'$profile_uid' => $_SESSION['uid'], '$profile_uid' => $_SESSION['uid'],
'$preview' => L10n::t('Preview'), '$preview' => L10n::t('Preview'),
'$jotplugins' => $jotplugins, '$jotplugins' => $jotplugins,

View file

@ -41,11 +41,7 @@ function follow_post(App $a) {
goaway(System::baseUrl().'/contacts/'.$result['cid']); goaway(System::baseUrl().'/contacts/'.$result['cid']);
} }
info(L10n::t('Contact added').EOL); info(L10n::t('The contact could not be added.').EOL);
if (strstr($return_url, 'contacts')) {
goaway(System::baseUrl().'/contacts/'.$contact_id);
}
goaway($return_url); goaway($return_url);
// NOTREACHED // NOTREACHED

View file

@ -222,6 +222,7 @@ function install_content(App $a) {
$dbdata = notags(trim($_POST['dbdata'])); $dbdata = notags(trim($_POST['dbdata']));
$phpath = notags(trim($_POST['phpath'])); $phpath = notags(trim($_POST['phpath']));
$adminmail = notags(trim($_POST['adminmail']));
$tpl = get_markup_template('install_db.tpl'); $tpl = get_markup_template('install_db.tpl');
$o .= replace_macros($tpl, [ $o .= replace_macros($tpl, [

View file

@ -30,7 +30,7 @@ function localtime_content(App $a)
$t = 'now'; $t = 'now';
} }
$o .= '<h3>' . L10n::t('Time Conversion') . '</h3>'; $o = '<h3>' . L10n::t('Time Conversion') . '</h3>';
$o .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>'; $o .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';

View file

@ -125,6 +125,7 @@ function lostpass_form()
function lostpass_generate_password($user) function lostpass_generate_password($user)
{ {
$o = ''; $o = '';
$a = get_app();
$new_password = User::generateNewPassword(); $new_password = User::generateNewPassword();
$result = User::updatePassword($user['uid'], $new_password); $result = User::updatePassword($user['uid'], $new_password);

View file

@ -250,7 +250,6 @@ function message_content(App $a)
'$to' => L10n::t('To:'), '$to' => L10n::t('To:'),
'$showinputs' => 'true', '$showinputs' => 'true',
'$prefill' => $prefill, '$prefill' => $prefill,
'$autocomp' => $autocomp,
'$preid' => $preid, '$preid' => $preid,
'$subject' => L10n::t('Subject:'), '$subject' => L10n::t('Subject:'),
'$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '', '$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '',

View file

@ -444,7 +444,7 @@ function networkFlatView(App $a, $update = 0)
} }
if (strlen($file)) { if (strlen($file)) {
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ", $sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
dbesc(protect_sprintf($file)), intval(TERM_OBJ_POST), intval(TERM_FILE), intval(local_user())); dbesc(protect_sprintf($file)), intval(TERM_OBJ_POST), intval(TERM_FILE), intval(local_user()));
} else { } else {
$sql_post_table = " INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`"; $sql_post_table = " INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`";

View file

@ -77,7 +77,7 @@ function notify_content(App $a)
$notif_content .= L10n::t('No more system notifications.'); $notif_content .= L10n::t('No more system notifications.');
} }
$o .= replace_macros($notif_tpl, [ $o = replace_macros($notif_tpl, [
'$notif_header' => L10n::t('System Notifications'), '$notif_header' => L10n::t('System Notifications'),
'$tabs' => false, // $tabs, '$tabs' => false, // $tabs,
'$notif_content' => $notif_content, '$notif_content' => $notif_content,

View file

@ -865,7 +865,7 @@ function photos_post(App $a)
// Create item container // Create item container
$lat = $lon = null; $lat = $lon = null;
if ($exif && $exif['GPS'] && Feature::isEnabled($channel_id, 'photo_location')) { if ($exif && $exif['GPS'] && Feature::isEnabled($page_owner_uid, 'photo_location')) {
$lat = Photo::getGps($exif['GPS']['GPSLatitude'], $exif['GPS']['GPSLatitudeRef']); $lat = Photo::getGps($exif['GPS']['GPSLatitude'], $exif['GPS']['GPSLatitudeRef']);
$lon = Photo::getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']); $lon = Photo::getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']);
} }

View file

@ -571,8 +571,8 @@ function ping_format_xml_data($data, $sysnotify, $notifs, $sysmsgs, $sysmsgs_inf
$forums = []; $forums = [];
if (count($forums_unseen)) { if (count($forums_unseen)) {
foreach ($forums_unseen as $key => $item) { foreach ($forums_unseen as $key => $item) {
$forums[$count . ':forum'] = $item['count']; $forums[$key . ':forum'] = $item['count'];
$forums[$count . ':@attributes'] = ['id' => $item['id']]; $forums[$key . ':@attributes'] = ['id' => $item['id']];
} }
$data['forums'] = $forums; $data['forums'] = $forums;
} }

View file

@ -138,11 +138,8 @@ function poke_init(App $a) {
Worker::add(PRIORITY_HIGH, "Notifier", "tag", $item_id); Worker::add(PRIORITY_HIGH, "Notifier", "tag", $item_id);
} }
Addon::callHooks('post_local_end', $arr); Addon::callHooks('post_local_end', $arr);
Worker::add(PRIORITY_HIGH, "Notifier", "like", $post_id);
return; return;
} }

View file

@ -15,7 +15,7 @@ function probe_content(App $a)
killme(); killme();
} }
$o .= '<h3>Probe Diagnostic</h3>'; $o = '<h3>Probe Diagnostic</h3>';
$o .= '<form action="probe" method="get">'; $o .= '<form action="probe" method="get">';
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] . '" />'; $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] . '" />';

View file

@ -257,7 +257,7 @@ function profile_photo_content(App $a) {
$tpl = get_markup_template('profile_photo.tpl'); $tpl = get_markup_template('profile_photo.tpl');
$o .= replace_macros($tpl,[ $o = replace_macros($tpl,[
'$user' => $a->user['nickname'], '$user' => $a->user['nickname'],
'$lbl_upfile' => L10n::t('Upload File:'), '$lbl_upfile' => L10n::t('Upload File:'),
'$lbl_profiles' => L10n::t('Select a profile:'), '$lbl_profiles' => L10n::t('Select a profile:'),
@ -272,9 +272,8 @@ function profile_photo_content(App $a) {
} }
else { else {
$filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext']; $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext'];
$resolution = $a->config['imagecrop_resolution'];
$tpl = get_markup_template("cropbody.tpl"); $tpl = get_markup_template("cropbody.tpl");
$o .= replace_macros($tpl,[ $o = replace_macros($tpl,[
'$filename' => $filename, '$filename' => $filename,
'$profile' => intval($_REQUEST['profile']), '$profile' => intval($_REQUEST['profile']),
'$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'], '$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],
@ -313,6 +312,7 @@ function profile_photo_crop_ui_head(App $a, Image $Image) {
$smallest = 0; $smallest = 0;
$filename = '';
$r = Photo::store($Image, local_user(), 0, $hash, $filename, L10n::t('Profile Photos'), 0); $r = Photo::store($Image, local_user(), 0, $hash, $filename, L10n::t('Profile Photos'), 0);

View file

@ -35,6 +35,8 @@ function profperm_content(App $a) {
return; return;
} }
$o = '';
// Switch to text mod interface if we have more than 'n' contacts or group members // Switch to text mod interface if we have more than 'n' contacts or group members
$switchtotext = PConfig::get(local_user(),'system','groupedit_image_limit'); $switchtotext = PConfig::get(local_user(),'system','groupedit_image_limit');
@ -165,4 +167,3 @@ function profperm_content(App $a) {
return $o; return $o;
} }

View file

@ -58,6 +58,7 @@ function register_post(App $a)
break; break;
} }
$netpublish = !empty($_POST['profile_publish_reg']);
$arr = $_POST; $arr = $_POST;

View file

@ -55,7 +55,7 @@ function user_allow($hash)
L10n::pushLang($register[0]['language']); L10n::pushLang($register[0]['language']);
User::sendRegisterOpenEmail( $res = User::sendRegisterOpenEmail(
$user[0]['email'], $user[0]['email'],
$a->config['sitename'], $a->config['sitename'],
System::baseUrl(), System::baseUrl(),
@ -100,7 +100,7 @@ function regmod_content(App $a)
if (!local_user()) { if (!local_user()) {
info(L10n::t('Please login.') . EOL); info(L10n::t('Please login.') . EOL);
$o .= '<br /><br />' . Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1); $o = '<br /><br />' . Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
return $o; return $o;
} }

View file

@ -49,7 +49,7 @@ function removeme_content(App $a)
$_SESSION['remove_account_verify'] = $hash; $_SESSION['remove_account_verify'] = $hash;
$tpl = get_markup_template('removeme.tpl'); $tpl = get_markup_template('removeme.tpl');
$o .= replace_macros($tpl, [ $o = replace_macros($tpl, [
'$basedir' => System::baseUrl(), '$basedir' => System::baseUrl(),
'$hash' => $hash, '$hash' => $hash,
'$title' => L10n::t('Remove My Account'), '$title' => L10n::t('Remove My Account'),

View file

@ -19,6 +19,7 @@ require_once 'mod/dirfind.php';
function search_saved_searches() { function search_saved_searches() {
$o = ''; $o = '';
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
if (! Feature::isEnabled(local_user(),'savedsearch')) if (! Feature::isEnabled(local_user(),'savedsearch'))
return $o; return $o;
@ -150,7 +151,7 @@ function search_content(App $a) {
} }
// contruct a wrapper for the search header // contruct a wrapper for the search header
$o .= replace_macros(get_markup_template("content_wrapper.tpl"),[ $o = replace_macros(get_markup_template("content_wrapper.tpl"),[
'name' => "search-header", 'name' => "search-header",
'$title' => L10n::t("Search"), '$title' => L10n::t("Search"),
'$title_size' => 3, '$title_size' => 3,

View file

@ -44,6 +44,8 @@ function tagger_content(App $a) {
$item = $r[0]; $item = $r[0];
$owner_uid = $item['uid']; $owner_uid = $item['uid'];
$owner_nick = '';
$blocktags = 0;
$r = q("select `nickname`,`blocktags` from user where uid = %d limit 1", $r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
intval($owner_uid) intval($owner_uid)
@ -71,8 +73,13 @@ function tagger_content(App $a) {
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status')); $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ); $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$link = xmlify('<link rel="alternate" type="text/html" href="' if ($owner_nick) {
. System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ; $href = System::baseUrl() . '/display/' . $owner_nick . '/' . $item['id'];
} else {
$href = System::baseUrl() . '/display/' . $item['guid'];
}
$link = xmlify('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n") ;
$body = xmlify($item['body']); $body = xmlify($item['body']);

View file

@ -46,6 +46,8 @@ function viewcontacts_content(App $a)
return; return;
} }
$is_owner = $a->profile['profile_uid'] == local_user();
$o = ""; $o = "";
// tabs // tabs
@ -97,9 +99,6 @@ function viewcontacts_content(App $a)
$url = $rr['url']; $url = $rr['url'];
// route DFRN profiles through the redirect // route DFRN profiles through the redirect
$is_owner = ((local_user() && ($a->profile['profile_uid'] == local_user())) ? true : false);
if ($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) { if ($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
$url = 'redir/' . $rr['id']; $url = 'redir/' . $rr['id'];
} else { } else {

View file

@ -13,6 +13,7 @@ function viewsrc_content(App $a) {
return; return;
} }
$o = '';
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if(! $item_id) { if(! $item_id) {

View file

@ -128,7 +128,7 @@ function wallmessage_content(App $a) {
]); ]);
$tpl = get_markup_template('wallmessage.tpl'); $tpl = get_markup_template('wallmessage.tpl');
$o .= replace_macros($tpl, [ $o = replace_macros($tpl, [
'$header' => L10n::t('Send Private Message'), '$header' => L10n::t('Send Private Message'),
'$subheader' => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']), '$subheader' => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
'$to' => L10n::t('To:'), '$to' => L10n::t('To:'),
@ -139,7 +139,6 @@ function wallmessage_content(App $a) {
'$text' => ((x($_REQUEST, 'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''), '$text' => ((x($_REQUEST, 'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
'$readonly' => '', '$readonly' => '',
'$yourmessage' => L10n::t('Your message:'), '$yourmessage' => L10n::t('Your message:'),
'$select' => $select,
'$parent' => '', '$parent' => '',
'$upload' => L10n::t('Upload photo'), '$upload' => L10n::t('Upload photo'),
'$insert' => L10n::t('Insert web link'), '$insert' => L10n::t('Insert web link'),

View file

@ -20,7 +20,7 @@ function webfinger_content(App $a)
killme(); killme();
} }
$o .= '<h3>Webfinger Diagnostic</h3>'; $o = '<h3>Webfinger Diagnostic</h3>';
$o .= '<form action="webfinger" method="get">'; $o .= '<form action="webfinger" method="get">';
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />'; $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';