Merge remote-tracking branch 'upstream/develop' into no-item
authorMichael <heluecht@pirati.ca>
Sun, 14 Feb 2021 22:44:38 +0000 (22:44 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 14 Feb 2021 22:44:38 +0000 (22:44 +0000)
12 files changed:
bin/dev/minifyjs.sh
doc/Text_comment.md
doc/Text_editor.md
doc/Update.md
doc/de/Text_comment.md
doc/de/Text_editor.md
doc/img/editor_frost.png [deleted file]
doc/img/frost.png [deleted file]
src/Content/OEmbed.php
src/Content/Text/BBCode.php
src/Module/Debug/Babel.php
view/theme/vier/style.css

index caa2b38..2c38cf8 100755 (executable)
@@ -9,13 +9,6 @@ JSFILES=(
        "view/js/country.js"
        "view/js/main.js"
        "vendor/asset/base64/base64.min.js"
-       "view/theme/frost/js/jquery.divgrow-1.3.1.f1.js"
-       "view/theme/frost/js/main.js"
-       "view/theme/frost/js/theme.js"
-       "view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js"
-       "view/theme/frost-mobile/js/main.js"
-       "view/theme/frost-mobile/js/theme.js"
-       "view/theme/decaf-mobile/js/theme.js"
 )
 JSFILES2=(
        "library/colorbox/jquery.colorbox.js"
index 2aac568..7cd26d5 100644 (file)
@@ -40,5 +40,3 @@ Darkzero  <img src="doc/img/darkzero.png" alt="darkzero.png" style="padding-left
 <span style="padding-left: 10px; font-style:italic;">(incl. more "zero"-themes, slackr, comix, easterbunny, facepark)</span>
 
 Dispy  <img src="doc/img/dispy.png" alt="dispy.png" style="padding-left: 57px; vertical-align:middle;"> <i>(incl. smoothly, testbubble)</i>
-
-Frost Mobile  <img src="doc/img/frost.png" alt="frost.png" style="padding-left: 16px; vertical-align:middle;">
index 07e1fa9..ebbaf22 100644 (file)
@@ -78,11 +78,6 @@ These icons can change depending on the theme. Some examples:
     <td><img src="doc/img/editor_darkbubble.png" alt="darkbubble.png" style="vertical-align:middle;"></td>
     <td>&nbsp;</td>
 </tr>
-<tr>
-    <td>Frost: </td>
-    <td><img src="doc/img/editor_frost.png" alt="frost.png" style="vertical-align:middle;"> </td>
-    <td>&nbsp;</td>
-</tr>
 </table>
 <i><b>*</b> how to [upload](help/FAQ#upload) files</i>
 <p style="clear:both;">&nbsp;</p>
index c4fe161..d019d03 100644 (file)
@@ -77,3 +77,29 @@ RENAME TABLE <table_name>_new TO <table_name>;
 ```
 
 This method is slower overall, but it is better suited for large numbers of duplicates.
+
+### Resolving Possible Database Issues Post Upgrading
+
+#### Foreign Keys
+
+Some of the updates include the use of foreign keys now that will bump into issues with previous versions, which would sometimes shove bad data into tables, preventing, causing errors such as below.
+
+```
+Error 1452 occurred during database update:
+Cannot add or update a child row: a foreign key constraint fails (`friendica`.`#sql-10ea6_5a6d`, CONSTRAINT `#sql-10ea6_5a6d_ibfk_1` FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`))
+ALTER TABLE `thread` ADD FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE; 
+```
+
+All current known fixes for possible items that can go wrong are as below.
+
+```SQL
+DELETE FROM `item` WHERE `owner-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `item` WHERE `contact-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `notify` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`);
+DELETE FROM `photo` WHERE `contact-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `thread` WHERE `iid` NOT IN (SELECT `id` FROM `item`);
+DELETE FROM `item` WHERE `author-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `diaspora-interaction` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`);
+```
+
+This all has been compiled as of currently from issue #9746, #9753, and #9878.
index 88e5e0b..6dc47a5 100644 (file)
@@ -57,5 +57,3 @@ Darkzero  <img src="doc/img/darkzero.png" alt="darkzero.png" style="padding-left
 <span style="padding-left: 10px; font-style:italic;">(inkl. weiterer "zero"-Themen, slackr, comix, easterbunny, facepark)</span>
 
 Dispy  <img src="doc/img/dispy.png" alt="dispy.png" style="padding-left: 57px; vertical-align:middle;"> <i>(inkl. smoothly, testbubble)</i>
-
-Frost Mobile  <img src="doc/img/frost.png" alt="frost.png" style="padding-left: 16px; vertical-align:middle;">
index 33fc104..5f90f3b 100644 (file)
@@ -54,6 +54,4 @@ Darkbubble  <img src="doc/img/editor_darkbubble.png" alt="darkbubble.png" style=
 
 Frio  <img src="doc/img/editor_frio.png" alt="frio.png" style="padding-left: 44px; vertical-align:middle;">
 
-Frost  <img src="doc/img/editor_frost.png" alt="frost.png" style="padding-left: 42px; vertical-align:middle;"> 
-
 Vier  <img src="doc/img/editor_vier.png" alt="vier.png" style="padding-left: 44px; vertical-align:middle;"> <i>(inkl. dispy)</i>
diff --git a/doc/img/editor_frost.png b/doc/img/editor_frost.png
deleted file mode 100644 (file)
index d0ac5a4..0000000
Binary files a/doc/img/editor_frost.png and /dev/null differ
diff --git a/doc/img/frost.png b/doc/img/frost.png
deleted file mode 100644 (file)
index 1b619a6..0000000
Binary files a/doc/img/frost.png and /dev/null differ
index 355dda3..1a5d1d9 100644 (file)
@@ -98,21 +98,23 @@ class OEmbed
                                // try oembed autodiscovery
                                $html_text = DI::httpRequest()->fetch($embedurl, 15, 'text/*');
                                if ($html_text) {
-                                       $dom = @DOMDocument::loadHTML($html_text);
-                                       if ($dom) {
+                                       $dom = new DOMDocument();
+                                       if ($dom->loadHTML($html_text)) {
                                                $xpath = new DOMXPath($dom);
-                                               $entries = $xpath->query("//link[@type='application/json+oembed']");
-                                               foreach ($entries as $e) {
-                                                       $href = $e->getAttributeNode('href')->nodeValue;
-                                                       $json_string = DI::httpRequest()->fetch($href . '&maxwidth=' . $a->videowidth);
-                                                       break;
-                                               }
-
-                                               $entries = $xpath->query("//link[@type='text/json+oembed']");
-                                               foreach ($entries as $e) {
-                                                       $href = $e->getAttributeNode('href')->nodeValue;
-                                                       $json_string = DI::httpRequest()->fetch($href . '&maxwidth=' . $a->videowidth);
-                                                       break;
+                                               foreach (
+                                                       $xpath->query("//link[@type='application/json+oembed'] | //link[@type='text/json+oembed']")
+                                                       as $link)
+                                               {
+                                                       $href = $link->getAttributeNode('href')->nodeValue;
+                                                       // Both Youtube and Vimeo output OEmbed endpoint URL with HTTP
+                                                       // but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
+                                                       $href = str_replace(['http://www.youtube.com/', 'http://player.vimeo.com/'],
+                                                               ['https://www.youtube.com/', 'https://player.vimeo.com/'], $href);
+                                                       $result = DI::httpRequest()->fetchFull($href . '&maxwidth=' . $a->videowidth);
+                                                       if ($result->getReturnCode() === 200) {
+                                                               $json_string = $result->getBody();
+                                                               break;
+                                                       }
                                                }
                                        }
                                }
@@ -337,10 +339,6 @@ class OEmbed
 
        public static function getHTML($url, $title = null)
        {
-               // Always embed the SSL version
-               $url = str_replace(["http://www.youtube.com/", "http://player.vimeo.com/"],
-                                       ["https://www.youtube.com/", "https://player.vimeo.com/"], $url);
-
                $o = self::fetchURL($url, !self::isAllowedURL($url));
 
                if (!is_object($o) || property_exists($o, 'type') && $o->type == 'error') {
index 66c1800..29b8d25 100644 (file)
@@ -1616,12 +1616,13 @@ class BBCode
                                        // html5 video and audio
                                        $text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4).*?)\[\/video\]/ism",
                                                '<video src="$1" controls width="' . $a->videowidth . '" height="' . $a->videoheight . '" loop="true"><a href="$1">$1</a></video>', $text);
-                                       $text = preg_replace("/\[video\](.*?)\[\/video\]/ism",
-                                               '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $text);
-                                       $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '<audio src="$1" controls><a href="$1">$1</a></audio>', $text);
 
                                        $text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", $try_oembed_callback, $text);
                                        $text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", $try_oembed_callback, $text);
+
+                                       $text = preg_replace("/\[video\](.*?)\[\/video\]/ism",
+                                               '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $text);
+                                       $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '<audio src="$1" controls><a href="$1">$1</a></audio>', $text);
                                } else {
                                        $text = preg_replace("/\[video\](.*?)\[\/video\]/ism",
                                                '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $text);
index e33f032..f4a0fa1 100644 (file)
@@ -246,29 +246,34 @@ class Babel extends BaseModule
                                case 'twitter':
                                        $json = trim($_REQUEST['text']);
 
-                                       $status = json_decode($json);
+                                       if (file_exists('addon/twitter/twitter.php')) {
+                                               require_once 'addon/twitter/twitter.php';
 
-                                       $results[] = [
-                                               'title'   => DI::l10n()->t('Decoded post'),
-                                               'content' => visible_whitespace(var_export($status, true)),
-                                       ];
+                                               if (parse_url($json) !== false) {
+                                                       preg_match('#^https?://(?:mobile\.|www\.)?twitter.com/[^/]+/status/(\d+).*#', $json, $matches);
+                                                       $status = twitter_statuses_show($matches[1]);
+                                               } else {
+                                                       $status = json_decode($json);
+                                               }
 
-                                       $postarray = [];
-                                       $postarray['object-type'] = Activity\ObjectType::NOTE;
+                                               $results[] = [
+                                                       'title'   => DI::l10n()->t('Decoded post'),
+                                                       'content' => visible_whitespace(var_export($status, true)),
+                                               ];
 
-                                       if (!empty($status->full_text)) {
-                                               $postarray['body'] = $status->full_text;
-                                       } else {
-                                               $postarray['body'] = $status->text;
-                                       }
+                                               $postarray = [];
+                                               $postarray['object-type'] = Activity\ObjectType::NOTE;
 
-                                       // When the post contains links then use the correct object type
-                                       if (count($status->entities->urls) > 0) {
-                                               $postarray['object-type'] = Activity\ObjectType::BOOKMARK;
-                                       }
+                                               if (!empty($status->full_text)) {
+                                                       $postarray['body'] = $status->full_text;
+                                               } else {
+                                                       $postarray['body'] = $status->text;
+                                               }
 
-                                       if (file_exists('addon/twitter/twitter.php')) {
-                                               require_once 'addon/twitter/twitter.php';
+                                               // When the post contains links then use the correct object type
+                                               if (count($status->entities->urls) > 0) {
+                                                       $postarray['object-type'] = Activity\ObjectType::BOOKMARK;
+                                               }
 
                                                $picture = \twitter_media_entities($status, $postarray);
 
@@ -307,7 +312,7 @@ class Babel extends BaseModule
                        '$type_markdown' => ['type', DI::l10n()->t('Markdown'), 'markdown', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'markdown'],
                        '$type_html'     => ['type', DI::l10n()->t('HTML'), 'html', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'html'],
                        '$flag_twitter'  => file_exists('addon/twitter/twitter.php'),
-                       '$type_twitter'  => ['type', DI::l10n()->t('Twitter Source'), 'twitter', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'twitter'],
+                       '$type_twitter'  => ['type', DI::l10n()->t('Twitter Source / Tweet URL (requires API key)'), 'twitter', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'twitter'],
                        '$results'       => $results
                ]);
 
index 0ef69f2..8bf9820 100644 (file)
@@ -2073,22 +2073,6 @@ section.minimal {
        margin-left: 15px;
        cursor: pointer;
 }
-#profile-smiley-wrapper {
-       float: left;
-       margin-left: 15px;
-       cursor: pointer;
-       margin-top: 3px;
-       height: 10px;
-       display: inline-block;
-}
-#smileybutton {
-       position: absolute;
-       z-index: 99;
-}
-table.smiley-preview {
-       background-color: #FFF;
-       box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
-}
 #jot-perms-icon {
        float: right;
        margin-left: 15px;