]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused method in Model\\Contact
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 13 Oct 2021 00:12:30 +0000 (20:12 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 16 Oct 2021 20:05:09 +0000 (16:05 -0400)
src/Model/Contact.php

index f095543ebdd725f560d426f0f423191aed7674c8..88cd8fdaf371d41f7d64e81dbc1f63000512580b 100644 (file)
@@ -2562,48 +2562,6 @@ class Contact
                return $result;
        }
 
-       /**
-        * Updated contact's SSL policy
-        *
-        * @param array  $contact    Contact array
-        * @param string $new_policy New policy, valid: self,full
-        *
-        * @return array Contact array with updated values
-        * @throws \Exception
-        */
-       public static function updateSslPolicy(array $contact, $new_policy)
-       {
-               $ssl_changed = false;
-               if ((intval($new_policy) == BaseURL::SSL_POLICY_SELFSIGN || $new_policy === 'self') && strstr($contact['url'], 'https:')) {
-                       $ssl_changed = true;
-                       $contact['url']     =   str_replace('https:', 'http:', $contact['url']);
-                       $contact['request'] =   str_replace('https:', 'http:', $contact['request']);
-                       $contact['notify']  =   str_replace('https:', 'http:', $contact['notify']);
-                       $contact['poll']    =   str_replace('https:', 'http:', $contact['poll']);
-                       $contact['confirm'] =   str_replace('https:', 'http:', $contact['confirm']);
-                       $contact['poco']    =   str_replace('https:', 'http:', $contact['poco']);
-               }
-
-               if ((intval($new_policy) == BaseURL::SSL_POLICY_FULL || $new_policy === 'full') && strstr($contact['url'], 'http:')) {
-                       $ssl_changed = true;
-                       $contact['url']     =   str_replace('http:', 'https:', $contact['url']);
-                       $contact['request'] =   str_replace('http:', 'https:', $contact['request']);
-                       $contact['notify']  =   str_replace('http:', 'https:', $contact['notify']);
-                       $contact['poll']    =   str_replace('http:', 'https:', $contact['poll']);
-                       $contact['confirm'] =   str_replace('http:', 'https:', $contact['confirm']);
-                       $contact['poco']    =   str_replace('http:', 'https:', $contact['poco']);
-               }
-
-               if ($ssl_changed) {
-                       $fields = ['url' => $contact['url'], 'request' => $contact['request'],
-                                       'notify' => $contact['notify'], 'poll' => $contact['poll'],
-                                       'confirm' => $contact['confirm'], 'poco' => $contact['poco']];
-                       self::update($fields, ['id' => $contact['id']]);
-               }
-
-               return $contact;
-       }
-
        /**
         * Follow a contact
         *