]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #4440 from rabuzarus/20180211_-_fix_variables_part_two
authorHypolite Petovan <mrpetovan@gmail.com>
Tue, 13 Feb 2018 00:53:39 +0000 (19:53 -0500)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2018 00:53:39 +0000 (19:53 -0500)
fix undeclared variables or wrong variable names (/mod) part 2

24 files changed:
mod/dfrn_request.php
mod/editpost.php
mod/follow.php
mod/install.php
mod/localtime.php
mod/lostpass.php
mod/message.php
mod/network.php
mod/notify.php
mod/photos.php
mod/ping.php
mod/poke.php
mod/probe.php
mod/profile_photo.php
mod/profperm.php
mod/register.php
mod/regmod.php
mod/removeme.php
mod/search.php
mod/tagger.php
mod/viewcontacts.php
mod/viewsrc.php
mod/wallmessage.php
mod/webfinger.php

index 34cc9cf258032308ef7cb88ff241f23d407492f0..e8bc5092625a9033c62afd2afd965bc96c961ac8 100644 (file)
@@ -168,7 +168,7 @@ function dfrn_request_post(App $a)
                                        $parms['key'] // this was already escaped
                                );
                                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)) {
                                                Contact::updateAvatar($photo, local_user(), $r[0]["id"], true);
index af8f4e317926648f6a8d9ee31a92a7c1ce0b3357..3081b67293730250e5f4fde90f687f8db9b64405 100644 (file)
@@ -38,6 +38,8 @@ function editpost_content(App $a) {
                return;
        }
 
+       $geotag = '';
+
        $o .= replace_macros(get_markup_template("section_title.tpl"),[
                '$title' => L10n::t('Edit post')
        ]);
@@ -61,10 +63,11 @@ function editpost_content(App $a) {
 
        $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';
-       else
+       } else {
                $lockstate = 'unlock';
+       }
 
        $jotplugins = '';
        $jotnets = '';
@@ -140,7 +143,7 @@ function editpost_content(App $a) {
                '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
                '$lockstate' => $lockstate,
                '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
-               '$bang' => (($group) ? '!' : ''),
+               '$bang' => ($lockstate === 'lock' ? '!' : ''),
                '$profile_uid' => $_SESSION['uid'],
                '$preview' => L10n::t('Preview'),
                '$jotplugins' => $jotplugins,
index a3270e30dd610ed8f6e128243748de6a43510c48..83263f4031e5d1181e810c2462024853affe1002 100644 (file)
@@ -41,11 +41,7 @@ function follow_post(App $a) {
                goaway(System::baseUrl().'/contacts/'.$result['cid']);
        }
 
-       info(L10n::t('Contact added').EOL);
-
-       if (strstr($return_url, 'contacts')) {
-               goaway(System::baseUrl().'/contacts/'.$contact_id);
-       }
+       info(L10n::t('The contact could not be added.').EOL);
 
        goaway($return_url);
        // NOTREACHED
index f3969a6f24b87e0d2f46c9162238921b70989c87..3adcb75aa45b007ab234fd6418bbccb8769cb3f8 100644 (file)
@@ -222,6 +222,7 @@ function install_content(App $a) {
                        $dbdata = notags(trim($_POST['dbdata']));
                        $phpath = notags(trim($_POST['phpath']));
 
+                       $adminmail = notags(trim($_POST['adminmail']));
 
                        $tpl = get_markup_template('install_db.tpl');
                        $o .= replace_macros($tpl, [
index b10f1571a0e162ea3e40468dcf6c90751455526f..9a754ac80d9edddc07892840ea897b31b9a43849 100644 (file)
@@ -30,7 +30,7 @@ function localtime_content(App $a)
                $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>';
 
index 73167e6fe0a9f3fdcc363184e0b6e60bf334dd0b..56ad7e30ef0e71225e73d6423a569d1b30568059 100644 (file)
@@ -125,6 +125,7 @@ function lostpass_form()
 function lostpass_generate_password($user)
 {
        $o = '';
+       $a = get_app();
 
        $new_password = User::generateNewPassword();
        $result = User::updatePassword($user['uid'], $new_password);
index f1e3b7645882fcc62d6ccbd75ab59e22517b1406..8940ee44b7832f207d8cb188298c069c6d1b71c1 100644 (file)
@@ -250,7 +250,6 @@ function message_content(App $a)
                        '$to' => L10n::t('To:'),
                        '$showinputs' => 'true',
                        '$prefill' => $prefill,
-                       '$autocomp' => $autocomp,
                        '$preid' => $preid,
                        '$subject' => L10n::t('Subject:'),
                        '$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '',
index 834eedf49b860908c35e111e787abfbb9501443b..3013e94984101597289ee99d94b1f101e20493c2 100644 (file)
@@ -444,7 +444,7 @@ function networkFlatView(App $a, $update = 0)
        }
 
        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()));
        } else {
                $sql_post_table = " INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`";
index 0ab2b0d4147b2e222c492fdfcd4fef57e16db6a0..dff7d147f0e10dfb788c7c05c98bc04bb8030ba4 100644 (file)
@@ -77,7 +77,7 @@ function notify_content(App $a)
                $notif_content .= L10n::t('No more system notifications.');
        }
 
-       $o .= replace_macros($notif_tpl, [
+       $o = replace_macros($notif_tpl, [
                '$notif_header' => L10n::t('System Notifications'),
                '$tabs' => false, // $tabs,
                '$notif_content' => $notif_content,
index 9515d17953c1c24511d7320b692e5f83d1e5a751..4b031e5b5e5c674deb5a5e8b94287d3a768ae4c0 100644 (file)
@@ -865,7 +865,7 @@ function photos_post(App $a)
 
        // Create item container
        $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']);
                $lon = Photo::getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']);
        }
index 1bb8f147f9a8f61a2d90066542a4b403ea0d7821..62ab2644c9b746b974985cd29510023e518dd038 100644 (file)
@@ -571,8 +571,8 @@ function ping_format_xml_data($data, $sysnotify, $notifs, $sysmsgs, $sysmsgs_inf
        $forums = [];
        if (count($forums_unseen)) {
                foreach ($forums_unseen as $key => $item) {
-                       $forums[$count . ':forum'] = $item['count'];
-                       $forums[$count . ':@attributes'] = ['id' => $item['id']];
+                       $forums[$key . ':forum'] = $item['count'];
+                       $forums[$key . ':@attributes'] = ['id' => $item['id']];
                }
                $data['forums'] = $forums;
        }
index 1e6c53e17520a440dee48843ab40e4422bb96671..c1207917398b5b9037fa704e9739f84776c549b2 100644 (file)
@@ -138,11 +138,8 @@ function poke_init(App $a) {
                Worker::add(PRIORITY_HIGH, "Notifier", "tag", $item_id);
        }
 
-
        Addon::callHooks('post_local_end', $arr);
 
-       Worker::add(PRIORITY_HIGH, "Notifier", "like", $post_id);
-
        return;
 }
 
index b4f6ff3a4db0b0646ea2fefa6b10bd40610400a5..5e7a5253fda20ed6c6733ce038ce88b8cdc5af38 100644 (file)
@@ -15,7 +15,7 @@ function probe_content(App $a)
                killme();
        }
 
-       $o .= '<h3>Probe Diagnostic</h3>';
+       $o  = '<h3>Probe Diagnostic</h3>';
 
        $o .= '<form action="probe" method="get">';
        $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] . '" />';
index 370e19ce5e840d5ce55637c1379c9386cc61a219..5556553cf96391c8d741068724afd2bb34ee7451 100644 (file)
@@ -257,7 +257,7 @@ function profile_photo_content(App $a) {
 
                $tpl = get_markup_template('profile_photo.tpl');
 
-               $o .= replace_macros($tpl,[
+               $o = replace_macros($tpl,[
                        '$user' => $a->user['nickname'],
                        '$lbl_upfile' => L10n::t('Upload File:'),
                        '$lbl_profiles' => L10n::t('Select a profile:'),
@@ -272,9 +272,8 @@ function profile_photo_content(App $a) {
        }
        else {
                $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext'];
-               $resolution = $a->config['imagecrop_resolution'];
                $tpl = get_markup_template("cropbody.tpl");
-               $o .= replace_macros($tpl,[
+               $o = replace_macros($tpl,[
                        '$filename' => $filename,
                        '$profile' => intval($_REQUEST['profile']),
                        '$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],
@@ -313,6 +312,7 @@ function profile_photo_crop_ui_head(App $a, Image $Image) {
 
 
        $smallest = 0;
+       $filename = '';
 
        $r = Photo::store($Image, local_user(), 0, $hash, $filename, L10n::t('Profile Photos'), 0);
 
index 3486a1df52e45aacd26996b96a499022bbd81854..0f864d42f3e2b8ca66ce83c31bf55787519e2c46 100644 (file)
@@ -35,6 +35,8 @@ function profperm_content(App $a) {
                return;
        }
 
+       $o = '';
+
        // Switch to text mod interface if we have more than 'n' contacts or group members
 
        $switchtotext = PConfig::get(local_user(),'system','groupedit_image_limit');
@@ -165,4 +167,3 @@ function profperm_content(App $a) {
        return $o;
 
 }
-
index bf87c9259fba559efd358dfae169508012c8a303..40aa7c1bc4e5b61ea00470345cf2428d89705d94 100644 (file)
@@ -58,6 +58,7 @@ function register_post(App $a)
                        break;
        }
 
+       $netpublish = !empty($_POST['profile_publish_reg']);
 
        $arr = $_POST;
 
index 89e348d5098124e0ba7f72c76e85d18cdea61a81..aa64986d069e486891ab6ebaeecf76696569c8cf 100644 (file)
@@ -55,7 +55,7 @@ function user_allow($hash)
 
        L10n::pushLang($register[0]['language']);
 
-       User::sendRegisterOpenEmail(
+       $res = User::sendRegisterOpenEmail(
                $user[0]['email'],
                $a->config['sitename'],
                System::baseUrl(),
@@ -100,7 +100,7 @@ function regmod_content(App $a)
 
        if (!local_user()) {
                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;
        }
 
index 27d501d66131ed1b253f866c60c4c1a7481529f1..0363bf9f32990ad900d182c2c14bd5719b22eaf9 100644 (file)
@@ -49,7 +49,7 @@ function removeme_content(App $a)
        $_SESSION['remove_account_verify'] = $hash;
 
        $tpl = get_markup_template('removeme.tpl');
-       $o .= replace_macros($tpl, [
+       $o = replace_macros($tpl, [
                '$basedir' => System::baseUrl(),
                '$hash' => $hash,
                '$title' => L10n::t('Remove My Account'),
index f1f10addbd5c418f1f4d6c607e95691ba8334b01..afe94121dbca37f28c39ab8c35d6500f6a5c8230 100644 (file)
@@ -19,6 +19,7 @@ require_once 'mod/dirfind.php';
 function search_saved_searches() {
 
        $o = '';
+       $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
 
        if (! Feature::isEnabled(local_user(),'savedsearch'))
                return $o;
@@ -150,7 +151,7 @@ function search_content(App $a) {
        }
 
        // 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",
                '$title' => L10n::t("Search"),
                '$title_size' => 3,
index 6016d443badee900be10820049bac10f971a0a37..c602613f1fa008cf9b74173b142761b8d8c2a940 100644 (file)
@@ -44,6 +44,8 @@ function tagger_content(App $a) {
        $item = $r[0];
 
        $owner_uid = $item['uid'];
+       $owner_nick = '';
+       $blocktags = 0;
 
        $r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
                intval($owner_uid)
@@ -71,8 +73,13 @@ function tagger_content(App $a) {
        $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
        $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
 
-       $link = xmlify('<link rel="alternate" type="text/html" href="'
-               . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
+       if ($owner_nick) {
+               $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']);
 
index b45980fec3f6dea1eb68b029269c296af819d15a..7763dc8bf7a9c4b88bbbaec9485218cf6dfbdfc4 100644 (file)
@@ -46,6 +46,8 @@ function viewcontacts_content(App $a)
                return;
        }
 
+       $is_owner = $a->profile['profile_uid'] == local_user();
+
        $o = "";
 
        // tabs
@@ -97,9 +99,6 @@ function viewcontacts_content(App $a)
                $url = $rr['url'];
 
                // 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'])) {
                        $url = 'redir/' . $rr['id'];
                } else {
index 376e2ef68e30984f04787c894473bdb558cd5f84..d2f0d01a07b183bc7b45f79f30e8f5b502363ad7 100644 (file)
@@ -13,6 +13,7 @@ function viewsrc_content(App $a) {
                return;
        }
 
+       $o = ''; 
        $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
 
        if(! $item_id) {
index 250b7d70d0aebc57d48ccd5d259bfcea57ea27dd..75aca1f68dad1e1041a74823cebcdb1a7a6ac996 100644 (file)
@@ -128,7 +128,7 @@ function wallmessage_content(App $a) {
        ]);
 
        $tpl = get_markup_template('wallmessage.tpl');
-       $o .= replace_macros($tpl, [
+       $o = replace_macros($tpl, [
                '$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']),
                '$to' => L10n::t('To:'),
@@ -139,7 +139,6 @@ function wallmessage_content(App $a) {
                '$text' => ((x($_REQUEST, 'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
                '$readonly' => '',
                '$yourmessage' => L10n::t('Your message:'),
-               '$select' => $select,
                '$parent' => '',
                '$upload' => L10n::t('Upload photo'),
                '$insert' => L10n::t('Insert web link'),
index c8867935278960b07ab235ae02fbf486277a212a..6f49a8f28c44ebf9ea33ca2a1f3aa9778a50e7e0 100644 (file)
@@ -20,7 +20,7 @@ function webfinger_content(App $a)
                killme();
        }
 
-       $o .= '<h3>Webfinger Diagnostic</h3>';
+       $o  = '<h3>Webfinger Diagnostic</h3>';
 
        $o .= '<form action="webfinger" method="get">';
        $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';