]> git.mxchange.org Git - friendica.git/blobdiff - include/network.php
Merge pull request #3792 from annando/dead-contacts
[friendica.git] / include / network.php
index 0319468517a3d41204691fa78a7d436fd3dac42f..11a0fffbe671a827c3e524e10ed0bc7b76def26c 100644 (file)
@@ -150,6 +150,10 @@ function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array()) {
                }
        }
 
+       if (Config::get('system', 'ipv4_resolve', false)) {
+               curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+       }
+
        if ($binary) {
                @curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
        }
@@ -278,6 +282,10 @@ function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0)
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
 
+       if (Config::get('system', 'ipv4_resolve', false)) {
+               curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+       }
+
        if (intval($timeout)) {
                curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
        } else {
@@ -732,7 +740,10 @@ function fix_contact_ssl_policy(&$contact,$new_policy) {
        }
 
        if ($ssl_changed) {
-               dba::update('contact', $contact, array('id' => $contact['id']));
+               $fields = array('url' => $contact['url'], 'request' => $contact['request'],
+                               'notify' => $contact['notify'], 'poll' => $contact['poll'],
+                               'confirm' => $contact['confirm'], 'poco' => $contact['poco']);
+               dba::update('contact', $fields, array('id' => $contact['id']));
        }
 }