]> git.mxchange.org Git - friendica.git/commitdiff
Fix: subscribing to the old followers hadn't worked
authorMichael <heluecht@pirati.ca>
Wed, 14 Mar 2018 00:27:15 +0000 (00:27 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 14 Mar 2018 00:27:15 +0000 (00:27 +0000)
mod/ostatus_subscribe.php
mod/settings.php
src/Util/Network.php
view/templates/settings/connectors.tpl
view/theme/frio/templates/settings/connectors.tpl

index 07f4647e69caed04160a948b1b8cb10f73eab288..e8ba144a1633a7b2e5d30d4a35ffb502096eab73 100644 (file)
@@ -29,12 +29,14 @@ function ostatus_subscribe_content(App $a) {
        if (PConfig::get($uid, "ostatus", "legacy_friends") == "") {
 
                if ($_REQUEST["url"] == "") {
+                       PConfig::delete($uid, "ostatus", "legacy_contact");
                        return $o.L10n::t("No contact provided.");
                }
 
                $contact = Probe::uri($_REQUEST["url"]);
 
                if (!$contact) {
+                       PConfig::delete($uid, "ostatus", "legacy_contact");
                        return $o.L10n::t("Couldn't fetch information for contact.");
                }
 
@@ -44,6 +46,7 @@ function ostatus_subscribe_content(App $a) {
                $data = Network::curl($api."statuses/friends.json?screen_name=".$contact["nick"]);
 
                if (!$data["success"]) {
+                       PConfig::delete($uid, "ostatus", "legacy_contact");
                        return $o.L10n::t("Couldn't fetch friends for contact.");
                }
 
index b2dc37324c919bc52554ee83445af7c2bab82934..5fd67afa127fae34d03946e5bd7966a9ce668053 100644 (file)
@@ -207,8 +207,7 @@ function settings_post(App $a)
                return;
        }
 
-       if (($a->argc > 1) && ($a->argv[1] == 'connectors'))
-       {
+       if (($a->argc > 1) && ($a->argv[1] == 'connectors')) {
                check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors');
 
                if (x($_POST, 'general-submit')) {
index c9955f800f40252d588504590016d266f2024a36..d25b799242e052bc4b3406c2b873bca97a166ee8 100644 (file)
@@ -217,7 +217,7 @@ class Network
 
                        $newurl = $curl_info['redirect_url'];
 
-                       if (($new_location_info['path'] == '') && ( $new_location_info['host'] != '')) {
+                       if (($new_location_info['path'] == '') && ($new_location_info['host'] != '')) {
                                $newurl = $new_location_info['scheme'] . '://' . $new_location_info['host'] . $old_location_info['path'];
                        }
 
@@ -229,6 +229,11 @@ class Network
                        if (strpos($newurl, '/') === 0) {
                                $newurl = $old_location_info["scheme"]."://".$old_location_info["host"].$newurl;
                        }
+                       $old_location_query = @parse_url($url, PHP_URL_QUERY);
+
+                       if ($old_location_query != '') {
+                               $newurl .= '?' . $old_location_query;
+                       }
 
                        if (filter_var($newurl, FILTER_VALIDATE_URL)) {
                                $redirects++;
index 58306fb2799e9a3dd3c07382b6988754300468c3..83ebd74f5fb19d68bd64d0c92063b2239f23f344 100644 (file)
@@ -22,7 +22,7 @@
 
        <p><a href="{{$repair_ostatus_url}}">{{$repair_ostatus_text}}</a></p>
 
-       <div class="settings-submit-wrapper" ><input type="submit" name="general-submit" class="settings-submit" value="{{$submit}}" /></div>
+       <div class="settings-submit-wrapper" ><input type="submit" id="general-submit" name="general-submit" class="settings-submit" value="{{$submit}}" /></div>
 </div>
 <div class="clear"></div>
 
index c388a6e25d75ad6d8a1f2105007f31cfb4ed8fae..e5d21158c250d7eb86720a05148636bb8885fae3 100644 (file)
@@ -28,7 +28,7 @@
                                                <p><a href="{{$repair_ostatus_url}}">{{$repair_ostatus_text}}</a></p>
 
                                                <div class="form-group pull-right settings-submit-wrapper" >
-                                                       <button type="submit" name="submit" class="btn btn-primary" value="{{$submit|escape:'html'}}">{{$submit}}</button>
+                                                       <button type="submit" id="general-submit" name="general-submit" class="btn btn-primary" value="{{$submit|escape:'html'}}">{{$submit}}</button>
                                                </div>
                                                <div class="clear"></div>
                                        </div>
@@ -67,4 +67,4 @@
 {{/if}}
 
        </form>
-</div>
\ No newline at end of file
+</div>