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);
*
* 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()
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;
*/
function is_site_admin()
{
- $a = get_app();
+ $a = \get_app();
$admin_email = Config::get('config', 'admin_email');
function get_temppath()
{
- $a = get_app();
+ $a = \get_app();
$temppath = Config::get("system", "temppath");
} else {
return dirname($path);
}
- }
+ }
}
$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();
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,
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."));
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,
namespace Friendica\Core;
+ use Friendica\BaseObject;
use Friendica\Core\Logger;
use Friendica\Core\System;
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';
*/
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');
*/
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);
$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) {
{
$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);