Merge remote-tracking branch 'upstream/develop' into no-item
This commit is contained in:
commit
751232d679
|
@ -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"
|
||||
|
|
|
@ -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;">
|
||||
|
|
|
@ -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> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Frost: </td>
|
||||
<td><img src="doc/img/editor_frost.png" alt="frost.png" style="vertical-align:middle;"> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<i><b>*</b> how to [upload](help/FAQ#upload) files</i>
|
||||
<p style="clear:both;"> </p>
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;">
|
||||
|
|
|
@ -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>
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1 KiB |
|
@ -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') {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -246,30 +246,35 @@ class Babel extends BaseModule
|
|||
case 'twitter':
|
||||
$json = trim($_REQUEST['text']);
|
||||
|
||||
$status = json_decode($json);
|
||||
|
||||
$results[] = [
|
||||
'title' => DI::l10n()->t('Decoded post'),
|
||||
'content' => visible_whitespace(var_export($status, true)),
|
||||
];
|
||||
|
||||
$postarray = [];
|
||||
$postarray['object-type'] = Activity\ObjectType::NOTE;
|
||||
|
||||
if (!empty($status->full_text)) {
|
||||
$postarray['body'] = $status->full_text;
|
||||
} else {
|
||||
$postarray['body'] = $status->text;
|
||||
}
|
||||
|
||||
// When the post contains links then use the correct object type
|
||||
if (count($status->entities->urls) > 0) {
|
||||
$postarray['object-type'] = Activity\ObjectType::BOOKMARK;
|
||||
}
|
||||
|
||||
if (file_exists('addon/twitter/twitter.php')) {
|
||||
require_once 'addon/twitter/twitter.php';
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
$results[] = [
|
||||
'title' => DI::l10n()->t('Decoded post'),
|
||||
'content' => visible_whitespace(var_export($status, true)),
|
||||
];
|
||||
|
||||
$postarray = [];
|
||||
$postarray['object-type'] = Activity\ObjectType::NOTE;
|
||||
|
||||
if (!empty($status->full_text)) {
|
||||
$postarray['body'] = $status->full_text;
|
||||
} else {
|
||||
$postarray['body'] = $status->text;
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
$results[] = [
|
||||
|
@ -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
|
||||
]);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue