]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'master' into develop
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 23 Mar 2018 10:15:55 +0000 (06:15 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Fri, 23 Mar 2018 10:15:55 +0000 (06:15 -0400)
30 files changed:
1  2 
CHANGELOG
INSTALL.txt
bin/worker.php
boot.php
database.sql
doc/Developers-Intro.md
doc/FAQ.md
doc/Install.md
doc/de/FAQ.md
doc/de/Install.md
doc/htconfig.md
include/api.php
include/conversation.php
include/enotify.php
index.php
mod/admin.php
mod/display.php
mod/settings.php
src/Content/Text/BBCode.php
src/Core/NotificationsManager.php
src/Core/Worker.php
src/Database/DBStructure.php
src/Model/Contact.php
src/Model/GContact.php
src/Model/User.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Protocol/Feed.php
src/Protocol/OStatus.php
src/Protocol/PortableContact.php

diff --cc CHANGELOG
Simple merge
diff --cc INSTALL.txt
Simple merge
diff --cc bin/worker.php
index 67f9fed1a501df6e96ccda4f2731e0cd724f925e,0000000000000000000000000000000000000000..b4b265283ccba3d60ea44a38ffc9b6d48c0a92e0
mode 100644,000000..100644
--- /dev/null
@@@ -1,66 -1,0 +1,66 @@@
- if (Config::get('system', 'maintenance', true)) {
 +#!/usr/bin/env php
 +<?php
 +/**
 + * @file bin/worker.php
 + * @brief Starts the background processing
 + */
 +
 +use Friendica\App;
 +use Friendica\BaseObject;
 +use Friendica\Core\Addon;
 +use Friendica\Core\Config;
 +use Friendica\Core\Worker;
 +
 +// Ensure that worker.php is executed from the base path of the installation
 +if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
 +      $directory = dirname($_SERVER["argv"][0]);
 +
 +      if (substr($directory, 0, 1) != "/") {
 +              $directory = $_SERVER["PWD"]."/".$directory;
 +      }
 +      $directory = realpath($directory."/..");
 +
 +      chdir($directory);
 +}
 +
 +require_once "boot.php";
 +require_once "include/dba.php";
 +
 +$a = new App(dirname(__DIR__));
 +BaseObject::setApp($a);
 +
 +require_once ".htconfig.php";
 +dba::connect($db_host, $db_user, $db_pass, $db_data);
 +unset($db_host, $db_user, $db_pass, $db_data);
 +
 +Config::load();
 +
 +// Check the database structure and possibly fixes it
 +check_db(true);
 +
 +// Quit when in maintenance
++if (Config::get('system', 'maintenance', false, true)) {
 +      return;
 +}
 +
 +$a->set_baseurl(Config::get('system', 'url'));
 +
 +Addon::loadHooks();
 +
 +$spawn = (($_SERVER["argc"] == 2) && ($_SERVER["argv"][1] == "spawn"));
 +
 +if ($spawn) {
 +      Worker::spawnWorker();
 +      killme();
 +}
 +
 +$run_cron = (($_SERVER["argc"] <= 1) || ($_SERVER["argv"][1] != "no_cron"));
 +
 +Worker::processQueue($run_cron);
 +
 +Worker::unclaimProcess();
 +
 +Worker::endProcess();
 +
 +killme();
 +
diff --cc boot.php
Simple merge
diff --cc database.sql
index 0b2b01707561eff9e9e1523a3696d38274bcc760,181e9e804a00d73f01014629d24b95b59442d06f..591569ad5f40e25b7aaa0c282e69bb923d82a3dd
@@@ -1,5 -1,5 +1,5 @@@
  -- ------------------------------------------
- -- Friendica 3.6-dev (Asparagus)
 --- Friendica 3.6-rc (Asparagus)
++-- Friendica 2018-05-dev (Tazmans Flax-lilly)
  -- DB_UPDATE_VERSION 1256
  -- ------------------------------------------
  
Simple merge
diff --cc doc/FAQ.md
Simple merge
diff --cc doc/Install.md
Simple merge
diff --cc doc/de/FAQ.md
Simple merge
Simple merge
diff --cc doc/htconfig.md
Simple merge
diff --cc include/api.php
Simple merge
Simple merge
Simple merge
diff --cc index.php
Simple merge
diff --cc mod/admin.php
Simple merge
diff --cc mod/display.php
Simple merge
Simple merge
index 1148103054c2e37e3613581e08b29af922cd729c,13d4e1b055f66b71c1e369fa5e6151819aee47b8..82c6f46980cbc8f5ab2f9e79e20626abb73172c4
@@@ -7,11 -5,11 +7,11 @@@
  namespace Friendica\Content\Text;
  
  use DOMDocument;
--use DomXPath;
++use DOMXPath;
  use Exception;
 +use Friendica\BaseObject;
  use Friendica\Content\OEmbed;
  use Friendica\Content\Smilies;
 -use Friendica\Content\Text\Plaintext;
  use Friendica\Core\Addon;
  use Friendica\Core\Cache;
  use Friendica\Core\Config;
@@@ -708,9 -706,10 +708,10 @@@ class BBCode extends BaseObjec
                                }
  
                                if ($data["description"] != "" && $data["description"] != $data["title"]) {
-                                       $return .= sprintf('<blockquote>%s</blockquote>', trim(self::convert($data["description"])));
+                                       // Sanitize the HTML by converting it to BBCode
 -                                      $bbcode = html2bbcode($data["description"]);
++                                      $bbcode = HTML::toBBCode($data["description"]);
+                                       $return .= sprintf('<blockquote>%s</blockquote>', trim(self::convert($bbcode)));
                                }
                                if ($data["type"] == "link") {
                                        $return .= sprintf('<sup><a href="%s">%s</a></sup>', $data['url'], parse_url($data['url'], PHP_URL_HOST));
                                }
  
                                $doc = new DOMDocument();
                                @$doc->loadHTML($body);
--                              $xpath = new DomXPath($doc);
++                              $xpath = new DOMXPath($doc);
                                $list = $xpath->query("//meta[@name]");
                                foreach ($list as $node) {
                                        $attr = [];
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0055f8d9babc3e392b78908784f48ac09f1cefa5,cc4b230831de489328c8d3ff6bc1b93b97726526..dd2105849611c05946ccb57017df466a9b4deb43
@@@ -3591,16 -3613,24 +3614,24 @@@ class Diaspor
                        $eventdata['end'] = DateTimeFormat::convert($event['finish'], "UTC", $eventdata['timezone'], $mask);
                }
                if ($event['summary']) {
 -                      $eventdata['summary'] = html_entity_decode(bb2diaspora($event['summary']));
 +                      $eventdata['summary'] = html_entity_decode(BBCode::toMarkdown($event['summary']));
                }
                if ($event['desc']) {
 -                      $eventdata['description'] = html_entity_decode(bb2diaspora($event['desc']));
 +                      $eventdata['description'] = html_entity_decode(BBCode::toMarkdown($event['desc']));
                }
                if ($event['location']) {
+                       $event['location'] = preg_replace("/\[map\](.*?)\[\/map\]/ism", '$1', $event['location']);
+                       $coord = Map::getCoordinates($event['location']);
                        $location = [];
 -                      $location["address"] = html_entity_decode(bb2diaspora($event['location']));
 +                      $location["address"] = html_entity_decode(BBCode::toMarkdown($event['location']));
-                       $location["lat"] = 0;
-                       $location["lng"] = 0;
+                       if (!empty($coord['lat']) && !empty($coord['lon'])) {
+                               $location["lat"] = $coord['lat'];
+                               $location["lng"] = $coord['lon'];
+                       } else {
+                               $location["lat"] = 0;
+                               $location["lng"] = 0;
+                       }
                        $eventdata['location'] = $location;
                }
  
Simple merge
index fd53772fd742f45167ebabb841290f42d5d7ec07,bf0cca90c21e91adcf233adcf1d668eeedb632c0..602d178bce2b77a5be73d2725619ff7d1fed693c
@@@ -658,8 -660,9 +660,9 @@@ class OStatu
                // Mastodon Content Warning
                if (($item["verb"] == ACTIVITY_POST) && $xpath->evaluate('boolean(atom:summary)', $entry)) {
                        $clear_text = $xpath->query('atom:summary/text()', $entry)->item(0)->nodeValue;
-                       $item["body"] = HTML::toBBCode($clear_text) . '[spoiler]' . $item["body"] . '[/spoiler]';
+                       if (!empty($clear_text)) {
 -                              $item['content-warning'] = html2bbcode($clear_text);
++                              $item['content-warning'] = HTML::toBBCode($clear_text);
+                       }
                }
  
                if (($self != '') && empty($item['protocol'])) {
Simple merge