]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Salmon.php
Merge pull request #10231 from MrPetovan/bug/warnings
[friendica.git] / src / Protocol / Salmon.php
index 77084591022b0fa2f994ab893dbc23de53d06228..81b1f7528d67f7725e0d0c96027b997505970e2c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,9 +22,9 @@
 namespace Friendica\Protocol;
 
 use Friendica\Core\Logger;
+use Friendica\DI;
 use Friendica\Network\Probe;
 use Friendica\Util\Crypto;
-use Friendica\Util\Network;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
 
@@ -72,7 +72,7 @@ class Salmon
                                                $ret[$x] = substr($ret[$x], 5);
                                        }
                                } elseif (Strings::normaliseLink($ret[$x]) == 'http://') {
-                                       $ret[$x] = Network::fetchUrl($ret[$x]);
+                                       $ret[$x] = DI::httpRequest()->fetch($ret[$x]);
                                }
                        }
                }
@@ -155,7 +155,7 @@ class Salmon
                $salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
 
                // slap them
-               $postResult = Network::post($url, $salmon, [
+               $postResult = DI::httpRequest()->post($url, $salmon, [
                        'Content-type: application/magic-envelope+xml',
                        'Content-length: ' . strlen($salmon)
                ]);
@@ -180,7 +180,7 @@ class Salmon
                        $salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
 
                        // slap them
-                       $postResult = Network::post($url, $salmon, [
+                       $postResult = DI::httpRequest()->post($url, $salmon, [
                                'Content-type: application/magic-envelope+xml',
                                'Content-length: ' . strlen($salmon)
                        ]);
@@ -203,7 +203,7 @@ class Salmon
                        $salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
 
                        // slap them
-                       $postResult = Network::post($url, $salmon, [
+                       $postResult = DI::httpRequest()->post($url, $salmon, [
                                'Content-type: application/magic-envelope+xml',
                                'Content-length: ' . strlen($salmon)]);
                        $return_code = $postResult->getReturnCode();
@@ -229,7 +229,7 @@ class Salmon
         */
        public static function salmonKey($pubkey)
        {
-               Crypto::pemToMe($pubkey, $m, $e);
-               return 'RSA' . '.' . Strings::base64UrlEncode($m, true) . '.' . Strings::base64UrlEncode($e, true);
+               Crypto::pemToMe($pubkey, $modulus, $exponent);
+               return 'RSA' . '.' . Strings::base64UrlEncode($modulus, true) . '.' . Strings::base64UrlEncode($exponent, true);
        }
 }