]> git.mxchange.org Git - friendica.git/commitdiff
Fixed NPF, new OAuth library added
authorMichael <heluecht@pirati.ca>
Tue, 4 Apr 2023 22:21:27 +0000 (22:21 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 4 Apr 2023 22:21:27 +0000 (22:21 +0000)
composer.json
composer.lock
src/Content/Text/NPF.php

index bb675c651ea8aefe38fc6caba7db771689f22e77..0a31151fddcae38959aed2f3872bd9126857e856 100644 (file)
@@ -35,6 +35,7 @@
                "friendica/json-ld": "^1.0",
                "geekwright/po": "^2.0",
                "guzzlehttp/guzzle": "^6.5",
+        "guzzlehttp/oauth-subscriber": "^0.6",
                "kornrunner/blurhash": "^1.2",
                "league/html-to-markdown": "^4.8",
                "level-2/dice": "^4",
index 280e979e9e9286d43dd1e29f91e1ef410923c0eb..10fa7563863b03880c9d0e9de40b6ce603ce3968 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "456d14e3ad9be265c5c9e6172a0d18d8",
+    "content-hash": "c208d7f5176358ea157f109c1c7d68dd",
     "packages": [
         {
             "name": "asika/simple-console",
             ],
             "time": "2022-06-20T22:16:07+00:00"
         },
+        {
+            "name": "guzzlehttp/oauth-subscriber",
+            "version": "0.6.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/oauth-subscriber.git",
+                "reference": "8d6cab29f8397e5712d00a383eeead36108a3c1f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/8d6cab29f8397e5712d00a383eeead36108a3c1f",
+                "reference": "8d6cab29f8397e5712d00a383eeead36108a3c1f",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/guzzle": "^6.5|^7.2",
+                "guzzlehttp/psr7": "^1.7|^2.0",
+                "php": ">=5.5.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0|^9.3.3"
+            },
+            "suggest": {
+                "ext-openssl": "Required to sign using RSA-SHA1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "0.6-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Subscriber\\Oauth\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                }
+            ],
+            "description": "Guzzle OAuth 1.0 subscriber",
+            "homepage": "http://guzzlephp.org/",
+            "keywords": [
+                "Guzzle",
+                "oauth"
+            ],
+            "time": "2021-07-13T12:01:32+00:00"
+        },
         {
             "name": "guzzlehttp/promises",
             "version": "1.5.2",
index d60b3a8e79462bb56eb2a9ec3b179ff07fcaa067..a919562c744830028de035d2f1fe2805cb0d2a62 100644 (file)
@@ -185,9 +185,6 @@ class NPF
 
        static private function getLevelByCallstack($callstack): int
        {
-               // Deactivated, since Tumblr seems to have issues with the indent level
-               return 0;
-
                $level = 0;
                foreach ($callstack as $entry) {
                        if (in_array($entry, ['ol', 'ul', 'blockquote'])) {
@@ -235,7 +232,7 @@ class NPF
                                        break;
        
                                case 'blockquote':                                      
-                                       $subtype = strlen($text) < 100 ? 'quote' : 'indented';
+                                       $subtype = mb_strlen($text) < 100 ? 'quote' : 'indented';
                                        break;
 
                                case 'pre':
@@ -293,10 +290,9 @@ class NPF
                        'text'      => $text,
                ];
 
-               // Deactivated since Tumblr has got issues with it
-               //if (!empty($formatting)) {
-               //      $block['formatting'] = $formatting;
-               //}
+               if (!empty($formatting)) {
+                       $block['formatting'] = $formatting;
+               }
 
                $level = self::getLevelByCallstack($callstack);
                if ($level > 0) {
@@ -491,13 +487,14 @@ class NPF
                        $block = [
                                'type' => 'text',
                                'text' => $element->textContent,
-                               // Deactivated, since Tumblr has got issues with the formatting
-                               //'formatting' => [
-                               //      'start' => 0,
-                               //      'end'   => strlen($element->textContent),
-                               //      'type'  => 'link',
-                               //      'url'   => $attributes['href']
-                               //]
+                               'formatting' => [
+                                       [
+                                               'start' => 0,
+                                               'end'   => mb_strlen($element->textContent),
+                                               'type'  => 'link',
+                                               'url'   => $attributes['href']
+                                       ]
+                               ]
                        ];
                }