]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch '2019.01-rc' into bug/6334-escape-get-app
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 6 Jan 2019 21:38:48 +0000 (16:38 -0500)
committerGitHub <noreply@github.com>
Sun, 6 Jan 2019 21:38:48 +0000 (16:38 -0500)
1  2 
boot.php
mod/lostpass.php
src/Core/Theme.php
src/Model/Profile.php
src/Model/User.php
src/Protocol/Diaspora.php
src/Protocol/OStatus.php

diff --combined boot.php
index cbaeeff0aa79fe0eea8a2b55bd78280d3825241b,4b95c89128ba32b96437a7297bc3e868c706d144..73f83e978a836c78e5ec6efaf154f2f53295a230
+++ b/boot.php
@@@ -35,7 -35,7 +35,7 @@@ use Friendica\Util\DateTimeFormat
  
  define('FRIENDICA_PLATFORM',     'Friendica');
  define('FRIENDICA_CODENAME',     'The Tazmans Flax-lily');
- define('FRIENDICA_VERSION',      '2018.12-rc');
+ define('FRIENDICA_VERSION',      '2019.01-rc');
  define('DFRN_PROTOCOL_VERSION',  '2.23');
  define('NEW_UPDATE_ROUTINE_VERSION', 1170);
  
@@@ -327,8 -327,6 +327,8 @@@ if (!defined('CURLE_OPERATION_TIMEDOUT'
   *
   * Useful in functions which require it but don't get it passed to them
   *
 + * @deprecated since version 2018.09
 + * @see BaseObject::getApp()
   * @return App
   */
  function get_app()
@@@ -459,7 -457,7 +459,7 @@@ function notice($s
                return;
        }
  
 -      $a = get_app();
 +      $a = \get_app();
        if (empty($_SESSION['sysmsg'])) {
                $_SESSION['sysmsg'] = [];
        }
   */
  function info($s)
  {
 -      $a = get_app();
 +      $a = \get_app();
  
        if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) {
                return;
@@@ -540,7 -538,7 +540,7 @@@ function feed_birthday($uid, $tz
   */
  function is_site_admin()
  {
 -      $a = get_app();
 +      $a = \get_app();
  
        $admin_email = Config::get('config', 'admin_email');
  
@@@ -649,7 -647,7 +649,7 @@@ function get_server(
  
  function get_temppath()
  {
 -      $a = get_app();
 +      $a = \get_app();
  
        $temppath = Config::get("system", "temppath");
  
@@@ -870,4 -868,4 +870,4 @@@ function rdirname($path, $levels = 1
        } else {
                return dirname($path);
        }
- }
+ }
diff --combined mod/lostpass.php
index 3803ebeeefdd69d742cd2d47e9878966255db36c,d36d32963d6bc368907e24a504f51a820d2ab400..cb2dd3ca3c9f03e565eb62f1218cba968016de64
@@@ -21,7 -21,7 +21,7 @@@ function lostpass_post(App $a
        }
  
        $condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
-       $user = DBA::selectFirst('user', ['uid', 'username', 'email', 'language'], $condition);
+       $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
        if (!DBA::isResult($user)) {
                notice(L10n::t('No valid account found.') . EOL);
                $a->internalRedirect();
@@@ -63,7 -63,7 +63,7 @@@
                The login details are as follows:
  
                Site Location:  %2$s
-               Login Name:     %3$s', $resetlink, System::baseUrl(), $user['email']));
+               Login Name:     %3$s', $resetlink, System::baseUrl(), $user['nickname']));
  
        notification([
                'type'     => SYSTEM_EMAIL,
@@@ -85,7 -85,7 +85,7 @@@ function lostpass_content(App $a
        if ($a->argc > 1) {
                $pwdreset_token = $a->argv[1];
  
-               $user = DBA::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time', 'language'], ['pwdreset' => $pwdreset_token]);
+               $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => $pwdreset_token]);
                if (!DBA::isResult($user)) {
                        notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
  
@@@ -127,7 -127,7 +127,7 @@@ function lostpass_form(
  function lostpass_generate_password($user)
  {
        $o = '';
 -      $a = get_app();
 +      $a = \get_app();
  
        $new_password = User::generateNewPassword();
        $result = User::updatePassword($user['uid'], $new_password);
                        Password:       %3$s
  
                        You may change that password from your account settings page after logging in.
-               ', System::baseUrl(), $user['email'], $new_password));
+               ', System::baseUrl(), $user['nickname'], $new_password));
  
                notification([
                        'type'     => SYSTEM_EMAIL,
diff --combined src/Core/Theme.php
index bfff67058dbbbab0859c9101149ffb0e31286093,73fba22407d140111a360c3587ca654afbcd9122..1ea39d606c763556a8ab94934e5b98e61e217801
@@@ -6,6 -6,7 +6,7 @@@
  
  namespace Friendica\Core;
  
+ use Friendica\BaseObject;
  use Friendica\Core\Logger;
  use Friendica\Core\System;
  
@@@ -46,7 -47,7 +47,7 @@@ class Them
                        return $info;
                }
  
 -              $a = get_app();
 +              $a = \get_app();
                $stamp1 = microtime(true);
                $theme_file = file_get_contents("view/theme/$theme/theme.php");
                $a->saveTimestamp($stamp1, "file");
                if ($root !== '' && $root[strlen($root) - 1] !== '/') {
                        $root = $root . '/';
                }
 -              $theme_info = get_app()->theme_info;
 +              $theme_info = \get_app()->theme_info;
                if (is_array($theme_info) && array_key_exists('extends', $theme_info)) {
                        $parent = $theme_info['extends'];
                } else {
                        $parent = 'NOPATH';
                }
 -              $theme = get_app()->getCurrentTheme();
 +              $theme = \get_app()->getCurrentTheme();
                $thname = $theme;
                $ext = substr($file, strrpos($file, '.') + 1);
                $paths = [
         */
        public static function getStylesheetPath($theme)
        {
-               $a = \get_app();
+               $a = BaseObject::getApp();
  
                $opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
                if (file_exists('view/theme/' . $theme . '/style.php')) {
-                       return 'view/theme/' . $theme . '/style.pcss' . $opts;
+                       if ($a->is_mobile) {
+                               // Workaround for iOS Safari not sending the cookie for static files
+                               return 'view/theme/' . $theme . '/style' . $opts;
+                       } else {
+                               return 'view/theme/' . $theme . '/style.pcss' . $opts;
+                       }
                }
  
                return 'view/theme/' . $theme . '/style.css';
diff --combined src/Model/Profile.php
index 36840c17fad4857f584e7ea26190a2a6823eeba6,39765e74ef0c4ebcc02d85f4217ac9f40b506ffc..49fb868e3a9f3307db49e6009dd5e8d71fd57538
@@@ -280,7 -280,7 +280,7 @@@ class Profil
         */
        private static function sidebar($profile, $block = 0, $show_connect = true)
        {
 -              $a = get_app();
 +              $a = \get_app();
  
                $o = '';
                $location = false;
                        $p['address'] = $p['location'];
                }
  
+               if (isset($p['address'])) {
+                       $p['address'] = BBCode::convert($p['address']);
+               }
                if (isset($p['photo'])) {
                        $p['photo'] = ProxyUtils::proxifyUrl($p['photo'], false, ProxyUtils::SIZE_SMALL);
                }
  
        public static function getBirthdays()
        {
 -              $a = get_app();
 +              $a = \get_app();
                $o = '';
  
                if (!local_user() || $a->is_mobile || $a->is_tablet) {
  
        public static function getEventsReminderHTML()
        {
 -              $a = get_app();
 +              $a = \get_app();
                $o = '';
  
                if (!local_user() || $a->is_mobile || $a->is_tablet) {
         */
        public static function openWebAuthInit($token)
        {
 -              $a = get_app();
 +              $a = \get_app();
  
                // Clean old OpenWebAuthToken entries.
                OpenWebAuthToken::purge('owt', '3 MINUTE');
diff --combined src/Model/User.php
index 49a486cba2ff6c091fca03888a2d4959f5c31bb7,a1a722f4cc024edd3d7f8426ff58bc3c58cda5b7..edf28969c2e562b6aeff69995c6340f39de9fe30
@@@ -406,7 -406,7 +406,7 @@@ class Use
         */
        public static function create(array $data)
        {
 -              $a = get_app();
 +              $a = \get_app();
                $return = ['user' => null, 'password' => ''];
  
                $using_invites = Config::get('system', 'invitation_only');
                        If you ever want to delete your account, you can do so at %3$s/removeme
  
                        Thank you and welcome to %2$s.',
-                       $user['email'], $sitename, $siteurl, $user['username'], $password
+                       $user['nickname'], $sitename, $siteurl, $user['username'], $password
                ));
  
                return notification([
                        return false;
                }
  
 -              $a = get_app();
 +              $a = \get_app();
  
                Logger::log('Removing user: ' . $uid);
  
index 95085c4e75c8d0a6c04c3fd71d9c01e18235ab29,152bc385d8f9758922839c6ec7fcc0d3c27fb154..ed583503411799c6b0735d1fd85d21148fed1029
@@@ -1326,15 -1326,8 +1326,8 @@@ class Diaspor
                        $x = false;
                }
  
-               // This will work for older Diaspora and Friendica servers
                if (!$x) {
-                       $source_url = $server."/p/".urlencode($guid).".xml";
-                       Logger::log("Fetch post from ".$source_url, Logger::DEBUG);
-                       $x = Network::fetchUrl($source_url);
-                       if (!$x) {
-                               return false;
-                       }
+                       return false;
                }
  
                $source_xml = XML::parseString($x);
         */
        private static function receiveRequestMakeFriend(array $importer, array $contact)
        {
 -              $a = get_app();
 +              $a = \get_app();
  
                if ($contact["rel"] == Contact::SHARING) {
                        DBA::update(
         */
        public static function transmit(array $owner, array $contact, $envelope, $public_batch, $queue_run = false, $guid = "", $no_queue = false)
        {
 -              $a = get_app();
 +              $a = \get_app();
  
                $enabled = intval(Config::get("system", "diaspora_enabled"));
                if (!$enabled) {
diff --combined src/Protocol/OStatus.php
index 79fb94cf8af70dc441609539b8b0f9df9b130477,1a6ce231d1f386e9ddddf26ca24660c6cac0a136..458fee162014b22e21fa313cb6b223a76daeca6d
@@@ -1228,7 -1228,7 +1228,7 @@@ class OStatu
        {
                $siteinfo = BBCode::getAttachedData($body);
  
-               if (($siteinfo["type"] == "photo")) {
+               if (($siteinfo["type"] == "photo") && (!empty($siteinfo["preview"]) || !empty($siteinfo["image"]))) {
                        if (isset($siteinfo["preview"])) {
                                $preview = $siteinfo["preview"];
                        } else {
         */
        private static function addHeader(DOMDocument $doc, array $owner, $filter, $feed_mode = false)
        {
 -              $a = get_app();
 +              $a = \get_app();
  
                $root = $doc->createElementNS(NAMESPACE_ATOM1, 'feed');
                $doc->appendChild($root);