Browse Source

Issue-#3873

Replace deprecated functions with new syntax.
pull/3875/head
Adam Magness 3 years ago
parent
commit
0dfa57948f
124 changed files with 827 additions and 687 deletions
  1. +31
    -30
      boot.php
  2. +3
    -3
      doc/themes.md
  3. +2
    -2
      friendica_test_data.sql
  4. +2
    -1
      include/Contact.php
  5. +3
    -2
      include/DirSearch.php
  6. +3
    -1
      include/Emailer.php
  7. +3
    -2
      include/NotificationsManager.php
  8. +7
    -6
      include/Photo.php
  9. +4
    -2
      include/Smilies.php
  10. +4
    -3
      include/acl_selectors.php
  11. +10
    -10
      include/api.php
  12. +3
    -3
      include/auth.php
  13. +1
    -1
      include/bbcode.php
  14. +12
    -12
      include/cache.php
  15. +1
    -1
      include/cli_startup.php
  16. +7
    -6
      include/contact_widgets.php
  17. +4
    -2
      include/conversation.php
  18. +7
    -7
      include/cron.php
  19. +4
    -4
      include/cronhooks.php
  20. +6
    -6
      include/cronjobs.php
  21. +3
    -1
      include/crypto.php
  22. +3
    -2
      include/datetime.php
  23. +3
    -3
      include/dbstructure.php
  24. +4
    -4
      include/delivery.php
  25. +7
    -6
      include/dfrn.php
  26. +6
    -6
      include/diaspora.php
  27. +7
    -6
      include/discover_poco.php
  28. +2
    -1
      include/enotify.php
  29. +2
    -1
      include/event.php
  30. +1
    -1
      include/expire.php
  31. +28
    -25
      include/features.php
  32. +6
    -5
      include/follow.php
  33. +2
    -1
      include/gprobe.php
  34. +2
    -1
      include/group.php
  35. +6
    -4
      include/identity.php
  36. +11
    -10
      include/items.php
  37. +1
    -1
      include/message.php
  38. +9
    -8
      include/nav.php
  39. +16
    -16
      include/network.php
  40. +6
    -5
      include/notifier.php
  41. +6
    -4
      include/oauth.php
  42. +1
    -1
      include/ostatus.php
  43. +1
    -1
      include/pgettext.php
  44. +2
    -1
      include/plaintext.php
  45. +2
    -1
      include/plugin.php
  46. +17
    -15
      include/post_update.php
  47. +4
    -2
      include/queue_fn.php
  48. +5
    -3
      include/security.php
  49. +1
    -1
      include/session.php
  50. +13
    -13
      include/socgraph.php
  51. +18
    -16
      include/text.php
  52. +2
    -1
      include/update_gcontact.php
  53. +6
    -5
      include/user.php
  54. +7
    -5
      index.php
  55. +2
    -3
      mod/acctlink.php
  56. +171
    -171
      mod/admin.php
  57. +2
    -1
      mod/api.php
  58. +2
    -1
      mod/apps.php
  59. +5
    -3
      mod/cal.php
  60. +2
    -1
      mod/crepair.php
  61. +4
    -2
      mod/dfrn_confirm.php
  62. +3
    -2
      mod/dfrn_notify.php
  63. +2
    -1
      mod/dfrn_poll.php
  64. +10
    -8
      mod/dfrn_request.php
  65. +5
    -4
      mod/directory.php
  66. +7
    -5
      mod/dirfind.php
  67. +3
    -2
      mod/display.php
  68. +2
    -1
      mod/editpost.php
  69. +2
    -1
      mod/events.php
  70. +2
    -1
      mod/filer.php
  71. +5
    -4
      mod/follow.php
  72. +4
    -2
      mod/group.php
  73. +2
    -1
      mod/hcard.php
  74. +3
    -2
      mod/home.php
  75. +6
    -5
      mod/hostxrd.php
  76. +2
    -1
      mod/hovercard.php
  77. +11
    -9
      mod/invite.php
  78. +6
    -5
      mod/item.php
  79. +2
    -1
      mod/match.php
  80. +3
    -2
      mod/newmember.php
  81. +2
    -1
      mod/openid.php
  82. +7
    -6
      mod/ostatus_subscribe.php
  83. +4
    -4
      mod/photos.php
  84. +7
    -5
      mod/profile.php
  85. +5
    -4
      mod/profile_photo.php
  86. +8
    -6
      mod/profiles.php
  87. +4
    -2
      mod/profperm.php
  88. +2
    -1
      mod/proxy.php
  89. +2
    -1
      mod/pubsubhubbub.php
  90. +2
    -1
      mod/qsearch.php
  91. +2
    -1
      mod/receive.php
  92. +12
    -10
      mod/register.php
  93. +2
    -1
      mod/regmod.php
  94. +2
    -1
      mod/salmon.php
  95. +7
    -6
      mod/search.php
  96. +6
    -5
      mod/statistics_json.php
  97. +2
    -1
      mod/uimport.php
  98. +2
    -1
      mod/update_community.php
  99. +2
    -1
      mod/update_display.php
  100. +3
    -2
      mod/update_network.php

+ 31
- 30
boot.php View File

@ -23,6 +23,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'a
use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Util\Lock;
require_once 'include/config.php';
@ -603,9 +604,9 @@ function is_ajax() {
*/
function check_db($via_worker) {
$build = get_config('system', 'build');
$build = Config::get('system', 'build');
if (!x($build)) {
set_config('system', 'build', DB_UPDATE_VERSION);
Config::set('system', 'build', DB_UPDATE_VERSION);
$build = DB_UPDATE_VERSION;
}
if ($build != DB_UPDATE_VERSION) {
@ -622,7 +623,7 @@ function check_db($via_worker) {
*/
function check_url(App $a) {
$url = get_config('system', 'url');
$url = Config::get('system', 'url');
// if the url isn't set or the stored url is radically different
// than the currently visited url, store the current value accordingly.
@ -631,10 +632,10 @@ function check_url(App $a) {
// We will only change the url to an ip address if there is no existing setting
if (!x($url)) {
$url = set_config('system', 'url', System::baseUrl());
$url = Config::set('system', 'url', System::baseUrl());
}
if ((!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) {
$url = set_config('system', 'url', System::baseUrl());
$url = Config::set('system', 'url', System::baseUrl());
}
return;
@ -644,9 +645,9 @@ function check_url(App $a) {
* @brief Automatic database updates
*/
function update_db(App $a) {
$build = get_config('system', 'build');
$build = Config::get('system', 'build');
if (!x($build)) {
$build = set_config('system', 'build', DB_UPDATE_VERSION);
$build = Config::set('system', 'build', DB_UPDATE_VERSION);
}
if ($build != DB_UPDATE_VERSION) {
@ -664,12 +665,12 @@ function update_db(App $a) {
if (DB_UPDATE_VERSION == UPDATE_VERSION) {
// Compare the current structure with the defined structure
$t = get_config('database', 'dbupdate_' . DB_UPDATE_VERSION);
$t = Config::get('database', 'dbupdate_' . DB_UPDATE_VERSION);
if ($t !== false) {
return;
}
set_config('database', 'dbupdate_' . DB_UPDATE_VERSION, time());
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, time());
// run old update routine (wich could modify the schema and
// conflits with new routine)
@ -693,7 +694,7 @@ function update_db(App $a) {
);
return;
} else {
set_config('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success');
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success');
}
// run any left update_nnnn functions in update.php
@ -720,11 +721,11 @@ function run_update_function($x) {
// If the update fails or times-out completely you may need to
// delete the config entry to try again.
$t = get_config('database', 'update_' . $x);
$t = Config::get('database', 'update_' . $x);
if ($t !== false) {
return false;
}
set_config('database', 'update_' . $x, time());
Config::set('database', 'update_' . $x, time());
// call the specific update
@ -739,13 +740,13 @@ function run_update_function($x) {
);
return false;
} else {
set_config('database', 'update_' . $x, 'success');
set_config('system', 'build', $x + 1);
Config::set('database', 'update_' . $x, 'success');
Config::set('system', 'build', $x + 1);
return true;
}
} else {
set_config('database', 'update_' . $x, 'success');
set_config('system', 'build', $x + 1);
Config::set('database', 'update_' . $x, 'success');
Config::set('system', 'build', $x + 1);
return true;
}
return true;
@ -774,7 +775,7 @@ function check_plugins(App $a) {
$installed = array();
}
$plugins = get_config('system', 'addon');
$plugins = Config::get('system', 'addon');
$plugins_arr = array();
if ($plugins) {
@ -852,7 +853,7 @@ function login($register = false, $hiddens = false) {
);
}
$noid = get_config('system', 'no_openid');
$noid = Config::get('system', 'no_openid');
$dest_url = $a->query_string;
@ -1007,7 +1008,7 @@ function notice($s) {
function info($s) {
$a = get_app();
if (local_user() && get_pconfig(local_user(), 'system', 'ignore_info')) {
if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) {
return;
}
@ -1063,7 +1064,7 @@ function current_theme() {
// This works only if the user is on the same server
if ($page_theme && local_user() && (local_user() != $a->profile_uid)) {
if (get_pconfig(local_user(), 'system', 'always_my_theme')) {
if (PConfig::get(local_user(), 'system', 'always_my_theme')) {
$page_theme = null;
}
}
@ -1304,7 +1305,7 @@ function random_digits($digits) {
}
function get_server() {
$server = get_config("system", "directory");
$server = Config::get("system", "directory");
if ($server == "") {
$server = "http://dir.friendica.social";
@ -1316,7 +1317,7 @@ function get_server() {
function get_temppath() {
$a = get_app();
$temppath = get_config("system", "temppath");
$temppath = Config::get("system", "temppath");
if (($temppath != "") && App::directory_usable($temppath)) {
// We have a temp path and it is usable
@ -1340,7 +1341,7 @@ function get_temppath() {
if (App::directory_usable($new_temppath)) {
// The new path is usable, we are happy
set_config("system", "temppath", $new_temppath);
Config::set("system", "temppath", $new_temppath);
return $new_temppath;
} else {
// We can't create a subdirectory, strange.
@ -1389,7 +1390,7 @@ function clear_cache($basepath = "", $path = "") {
return;
}
$cachetime = (int) get_config('system', 'itemcache_duration');
$cachetime = (int) Config::get('system', 'itemcache_duration');
if ($cachetime == 0) {
$cachetime = 86400;
}
@ -1412,12 +1413,12 @@ function clear_cache($basepath = "", $path = "") {
function get_itemcachepath() {
// Checking, if the cache is deactivated
$cachetime = (int) get_config('system', 'itemcache_duration');
$cachetime = (int) Config::get('system', 'itemcache_duration');
if ($cachetime < 0) {
return "";
}
$itemcache = get_config('system', 'itemcache');
$itemcache = Config::get('system', 'itemcache');
if (($itemcache != "") && App::directory_usable($itemcache)) {
return App::realpath($itemcache);
}
@ -1431,7 +1432,7 @@ function get_itemcachepath() {
}
if (App::directory_usable($itemcache)) {
set_config("system", "itemcache", $itemcache);
Config::set("system", "itemcache", $itemcache);
return $itemcache;
}
}
@ -1444,7 +1445,7 @@ function get_itemcachepath() {
* @return string Spool path
*/
function get_spoolpath() {
$spoolpath = get_config('system', 'spoolpath');
$spoolpath = Config::get('system', 'spoolpath');
if (($spoolpath != "") && App::directory_usable($spoolpath)) {
// We have a spool path and it is usable
return $spoolpath;
@ -1462,7 +1463,7 @@ function get_spoolpath() {
if (App::directory_usable($spoolpath)) {
// The new path is usable, we are happy
set_config("system", "spoolpath", $spoolpath);
Config::set("system", "spoolpath", $spoolpath);
return $spoolpath;
} else {
// We can't create a subdirectory, strange.
@ -1574,7 +1575,7 @@ function argv($x) {
*/
function infinite_scroll_data($module) {
if (get_pconfig(local_user(), 'system', 'infinite_scroll')
if (PConfig::get(local_user(), 'system', 'infinite_scroll')
&& ($module == "network") && ($_GET["mode"] != "minimal")) {
// get the page number


+ 3
- 3
doc/themes.md View File

@ -130,7 +130,7 @@ The selected 1st part will be saved in the database by the theme_post function.
// if the one specific submit button was pressed then proceed
if (isset($_POST['duepuntozero-settings-submit'])){
// and save the selection key into the personal config of the user
set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
PConfig::set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
}
@ -138,9 +138,9 @@ Now that this information is set in the database, what should friendica do with
For this, have a look at the theme.php file of the *duepunto zero*.
There you'll find somethink alike
$colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
$colorset = PConfig::get( local_user(), 'duepuntozero','colorset');
if (!$colorset)
$colorset = get_config('duepuntozero', 'colorset');
$colorset = Config::get('duepuntozero', 'colorset');
if ($colorset) {
if ($colorset == 'greenzero')
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";


+ 2
- 2
friendica_test_data.sql
File diff suppressed because it is too large
View File


+ 2
- 1
include/Contact.php View File

@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Network\Probe;
@ -50,7 +51,7 @@ function contact_remove($id) {
return;
}
$archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts');
$archive = PConfig::get($r[0]['uid'], 'system','archive_removed_contacts');
if ($archive) {
q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d",
intval($id)


+ 3
- 2
include/DirSearch.php View File

@ -5,6 +5,7 @@
* @brief This file includes the DirSearch class with directory related functions
*/
use Friendica\Core\Config;
/**
* @brief This class handels directory related functions
@ -22,12 +23,12 @@ class DirSearch {
if($search) {
// check supported networks
if (get_config('system','diaspora_enabled'))
if (Config::get('system','diaspora_enabled'))
$diaspora = NETWORK_DIASPORA;
else
$diaspora = NETWORK_DFRN;
if (!get_config('system','ostatus_disabled'))
if (!Config::get('system','ostatus_disabled'))
$ostatus = NETWORK_OSTATUS;
else
$ostatus = NETWORK_DFRN;


+ 3
- 1
include/Emailer.php View File

@ -1,5 +1,7 @@
<?php
use Friendica\Core\PConfig;
require_once('include/email.php');
class Emailer {
@ -22,7 +24,7 @@ class Emailer {
$email_textonly = False;
if (x($params,"uid")) {
$email_textonly = get_pconfig($params['uid'], "system", "email_textonly");
$email_textonly = PConfig::get($params['uid'], "system", "email_textonly");
}
$fromName = email_header_encode(html_entity_decode($params['fromName'],ENT_QUOTES,'UTF-8'),'UTF-8');


+ 3
- 2
include/NotificationsManager.php View File

@ -5,6 +5,7 @@
* or for formatting notifications
*/
use Friendica\Core\Pconfig;
use Friendica\Core\System;
require_once 'include/html2plain.php';
@ -781,7 +782,7 @@ class NotificationsManager {
'name' => $it['fname'],
'url' => zrl($it['furl']),
'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0),
'post_newfriend' => (intval(PConfig::get(local_user(),'system','post_newfriend')) ? '1' : 0),
'knowyou' => $knowyou,
'note' => $it['note'],
@ -814,7 +815,7 @@ class NotificationsManager {
'keywords' => $it['gkeywords'],
'gender' => $it['ggender'],
'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0),
'post_newfriend' => (intval(PConfig::get(local_user(),'system','post_newfriend')) ? '1' : 0),
'url' => $it['url'],
'zrl' => zrl($it['url']),
'addr' => $it['gaddr'],


+ 7
- 6
include/Photo.php View File

@ -5,6 +5,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
require_once("include/photos.php");
@ -119,7 +120,7 @@ class Photo {
*/
switch($this->getType()){
case "image/png":
$quality = get_config('system', 'png_quality');
$quality = Config::get('system', 'png_quality');
if ((! $quality) || ($quality > 9)) {
$quality = PNG_QUALITY;
}
@ -135,7 +136,7 @@ class Photo {
$this->image->setCompressionQuality($quality);
break;
case "image/jpeg":
$quality = get_config('system', 'jpeg_quality');
$quality = Config::get('system', 'jpeg_quality');
if ((! $quality) || ($quality > 100)) {
$quality = JPEG_QUALITY;
}
@ -605,14 +606,14 @@ class Photo {
switch($this->getType()){
case "image/png":
$quality = get_config('system', 'png_quality');
$quality = Config::get('system', 'png_quality');
if ((!$quality) || ($quality > 9)) {
$quality = PNG_QUALITY;
}
imagepng($this->image, null, $quality);
break;
case "image/jpeg":
$quality = get_config('system', 'jpeg_quality');
$quality = Config::get('system', 'jpeg_quality');
if ((!$quality) || ($quality > 100)) {
$quality = JPEG_QUALITY;
}
@ -940,7 +941,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") {
$a->save_timestamp($stamp1, "file");
}
$maximagesize = get_config('system', 'maximagesize');
$maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && (strlen($imagedata) > $maximagesize)) {
logger("Image exceeds size limit of ".$maximagesize, LOGGER_DEBUG);
@ -972,7 +973,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") {
$ph->orient($tempfile);
unlink($tempfile);
$max_length = get_config('system', 'max_image_length');
$max_length = Config::get('system', 'max_image_length');
if (! $max_length) {
$max_length = MAX_IMAGE_LENGTH;
}


+ 4
- 2
include/Smilies.php View File

@ -14,6 +14,8 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
/**
@ -156,8 +158,8 @@ class Smilies {
* @return string HML Output of the Smilie
*/
public static function replace($s, $sample = false, $no_images = false) {
if(intval(get_config('system','no_smilies'))
|| (local_user() && intval(get_pconfig(local_user(),'system','no_smilies'))))
if(intval(Config::get('system','no_smilies'))
|| (local_user() && intval(PConfig::get(local_user(),'system','no_smilies'))))
return $s;
$s = preg_replace_callback('/<pre>(.*?)<\/pre>/ism','self::encode',$s);


+ 4
- 3
include/acl_selectors.php View File

@ -5,6 +5,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
require_once "include/contact_selectors.php";
require_once "include/contact_widgets.php";
@ -332,7 +333,7 @@ function populate_acl($user = null, $show_jotnets = false) {
$jotnets = '';
if ($show_jotnets) {
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
$mail_disabled = ((function_exists('imap_open') && (! Config::get('system','imap_disabled'))) ? 0 : 1);
$mail_enabled = false;
$pubmail_enabled = false;
@ -757,12 +758,12 @@ function navbar_complete(App $a) {
// logger('navbar_complete');
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
if ((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
return;
}
// check if searching in the local global contact table is enabled
$localsearch = get_config('system','poco_local_search');
$localsearch = Config::get('system','poco_local_search');
$search = $prefix.notags(trim($_REQUEST['search']));
$mode = $_REQUEST['smode'];


+ 10
- 10
include/api.php View File

@ -297,7 +297,7 @@ $called_api = null;
$duration = (float) (microtime(true) - $stamp);
logger("API call duration: " . round($duration, 2) . "\t" . $a->query_string, LOGGER_DEBUG);
if (get_config("system", "profiler")) {
if (Config::get("system", "profiler")) {
$duration = microtime(true)-$a->performance["start"];
/// @TODO round() really everywhere?
@ -312,7 +312,7 @@ $called_api = null;
LOGGER_DEBUG
);
if (get_config("rendertime", "callstack")) {
if (Config::get("rendertime", "callstack")) {
$o = "Database Read:\n";
foreach ($a->callstack["database"] AS $func => $time) {
$time = round($time, 3);
@ -1084,7 +1084,7 @@ $called_api = null;
$_REQUEST['type'] = 'net-comment';
} else {
// Check for throttling (maximum posts per day, week and month)
$throttle_day = get_config('system','throttle_limit_day');
$throttle_day = Config::get('system','throttle_limit_day');
if ($throttle_day > 0) {
$datefrom = date("Y-m-d H:i:s", time() - 24*60*60);
@ -1105,7 +1105,7 @@ $called_api = null;
}
}
$throttle_week = get_config('system','throttle_limit_week');
$throttle_week = Config::get('system','throttle_limit_week');
if ($throttle_week > 0) {
$datefrom = date("Y-m-d H:i:s", time() - 24*60*60*7);
@ -1126,7 +1126,7 @@ $called_api = null;
}
}
$throttle_month = get_config('system','throttle_limit_month');
$throttle_month = Config::get('system','throttle_limit_month');
if ($throttle_month > 0) {
$datefrom = date("Y-m-d H:i:s", time() - 24*60*60*30);
@ -2464,7 +2464,7 @@ $called_api = null;
if ($image) {
// If image cache is activated, then use the following sizes:
// thumb (150), small (340), medium (600) and large (1024)
if (!get_config("system", "proxy_disabled")) {
if (!Config::get("system", "proxy_disabled")) {
$media_url = proxy_url($url);
$sizes = array();
@ -3761,7 +3761,7 @@ $called_api = null;
// Update global directory in background
//$user = api_get_user(get_app());
$url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
if ($url && strlen(get_config('system', 'directory'))) {
if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "directory", $url);
}
@ -3854,7 +3854,7 @@ $called_api = null;
throw new InternalServerErrorException("image size exceeds PHP config settings, file was rejected by server");
}
// check against max upload size within Friendica instance
$maximagesize = get_config('system', 'maximagesize');
$maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) {
$formattedBytes = formatBytes($maximagesize);
throw new InternalServerErrorException("image size exceeds Friendica config setting (uploaded size: $formattedBytes)");
@ -3872,7 +3872,7 @@ $called_api = null;
@unlink($src);
// check max length of images on server
$max_length = get_config('system', 'max_image_length');
$max_length = Config::get('system', 'max_image_length');
if (! $max_length) {
$max_length = MAX_IMAGE_LENGTH;
}
@ -4947,7 +4947,7 @@ $called_api = null;
// retrieve general information about profiles for user
$multi_profiles = feature_enabled(api_user(),'multi_profiles');
$directory = get_config('system', 'directory');
$directory = Config::get('system', 'directory');
// get data of the specified profile id or all profiles of the user if not specified
if ($profileid != 0) {


+ 3
- 3
include/auth.php View File

@ -33,7 +33,7 @@ if (isset($_COOKIE["Friendica"])) {
if (!isset($_SESSION) || !isset($_SESSION['authenticated'])) {
authenticate_success($r[0]);
if (get_config('system','paranoia'))
if (Config::get('system','paranoia'))
$_SESSION['addr'] = $data->ip;
}
}
@ -67,7 +67,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
// already logged in user returning
$check = get_config('system','paranoia');
$check = Config::get('system','paranoia');
// extra paranoia - if the IP changed, log them out
if ($check && ($_SESSION['addr'] != $_SERVER['REMOTE_ADDR'])) {
logger('Session address changed. Paranoid setting in effect, blocking session. '.
@ -109,7 +109,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
if ((x($_POST,'openid_url')) && strlen($_POST['openid_url']) ||
(x($_POST,'username')) && strlen($_POST['username'])) {
$noid = get_config('system','no_openid');
$noid = Config::get('system','no_openid');
$openid_url = trim((strlen($_POST['openid_url'])?$_POST['openid_url']:$_POST['username']));


+ 1
- 1
include/bbcode.php View File

@ -913,7 +913,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
$Text = str_replace("\r\n", "\n", $Text);
// removing multiplicated newlines
if (get_config("system", "remove_multiplicated_lines")) {
if (Config::get("system", "remove_multiplicated_lines")) {
$search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n",
"\n[h1]", "[/h1]\n", "\n[h2]", "[/h2]\n", "\n[h3]", "[/h3]\n", "\n[h4]", "[/h4]\n", "\n[h5]", "[/h5]\n", "\n[h6]", "[/h6]\n");
$replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]",


+ 12
- 12
include/cache.php View File

@ -154,7 +154,7 @@ class Cache {
public static function clear($max_level = CACHE_MONTH) {
// Clear long lasting cache entries only once a day
if (get_config("system", "cache_cleared_day") < time() - self::duration(CACHE_DAY)) {
if (Config::get("system", "cache_cleared_day") < time() - self::duration(CACHE_DAY)) {
if ($max_level == CACHE_MONTH) {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 30 days")), intval(CACHE_MONTH));
@ -169,42 +169,42 @@ class Cache {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 1 days")), intval(CACHE_DAY));
}
set_config("system", "cache_cleared_day", time());
Config::set("system", "cache_cleared_day", time());
}
if (($max_level <= CACHE_HOUR) && (get_config("system", "cache_cleared_hour")) < time() - self::duration(CACHE_HOUR)) {
if (($max_level <= CACHE_HOUR) && (Config::get("system", "cache_cleared_hour")) < time() - self::duration(CACHE_HOUR)) {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 1 hours")), intval(CACHE_HOUR));
set_config("system", "cache_cleared_hour", time());
Config::set("system", "cache_cleared_hour", time());
}
if (($max_level <= CACHE_HALF_HOUR) && (get_config("system", "cache_cleared_half_hour")) < time() - self::duration(CACHE_HALF_HOUR)) {
if (($max_level <= CACHE_HALF_HOUR) && (Config::get("system", "cache_cleared_half_hour")) < time() - self::duration(CACHE_HALF_HOUR)) {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 30 minutes")), intval(CACHE_HALF_HOUR));
set_config("system", "cache_cleared_half_hour", time());
Config::set("system", "cache_cleared_half_hour", time());
}
if (($max_level <= CACHE_QUARTER_HOUR) && (get_config("system", "cache_cleared_quarter_hour")) < time() - self::duration(CACHE_QUARTER_HOUR)) {
if (($max_level <= CACHE_QUARTER_HOUR) && (Config::get("system", "cache_cleared_quarter_hour")) < time() - self::duration(CACHE_QUARTER_HOUR)) {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 15 minutes")), intval(CACHE_QUARTER_HOUR));
set_config("system", "cache_cleared_quarter_hour", time());
Config::set("system", "cache_cleared_quarter_hour", time());
}
if (($max_level <= CACHE_FIVE_MINUTES) && (get_config("system", "cache_cleared_five_minute")) < time() - self::duration(CACHE_FIVE_MINUTES)) {
if (($max_level <= CACHE_FIVE_MINUTES) && (Config::get("system", "cache_cleared_five_minute")) < time() - self::duration(CACHE_FIVE_MINUTES)) {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 5 minutes")), intval(CACHE_FIVE_MINUTES));
set_config("system", "cache_cleared_five_minute", time());
Config::set("system", "cache_cleared_five_minute", time());
}
if (($max_level <= CACHE_MINUTE) && (get_config("system", "cache_cleared_minute")) < time() - self::duration(CACHE_MINUTE)) {
if (($max_level <= CACHE_MINUTE) && (Config::get("system", "cache_cleared_minute")) < time() - self::duration(CACHE_MINUTE)) {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 1 minutes")), intval(CACHE_MINUTE));
set_config("system", "cache_cleared_minute", time());
Config::set("system", "cache_cleared_minute", time());
}
}
}

+ 1
- 1
include/cli_startup.php View File

@ -23,7 +23,7 @@ function cli_startup() {
Config::load();
$a->set_baseurl(get_config('system','url'));
$a->set_baseurl(Config::get('system','url'));
load_hooks();
}

+ 7
- 6
include/contact_widgets.php View File

@ -3,6 +3,7 @@
use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
require_once 'include/contact_selectors.php';
@ -24,8 +25,8 @@ function findpeople_widget() {
$a = get_app();
$global_dir = Config::get('system', 'directory');
if (get_config('system', 'invitation_only')) {
$x = get_pconfig(local_user(), 'system', 'invites_remaining');
if (Config::get('system', 'invitation_only')) {
$x = PConfig::get(local_user(), 'system', 'invites_remaining');
if ($x || is_site_admin()) {
$a->page['aside'] .= '<div class="side-link" id="side-invite-remain">'
. sprintf( tt('%d invitation available', '%d invitations available', $x), $x)
@ -74,11 +75,11 @@ function unavailable_networks() {
$networks[] = NETWORK_TWITTER;
}
if (get_config("system", "ostatus_disabled")) {
if (Config::get("system", "ostatus_disabled")) {
$networks[] = NETWORK_OSTATUS;
}
if (!get_config("system", "diaspora_enabled")) {
if (!Config::get("system", "diaspora_enabled")) {
$networks[] = NETWORK_DIASPORA;
}
@ -148,7 +149,7 @@ function fileas_widget($baseurl, $selected = '') {
return '';
}
$saved = get_pconfig(local_user(), 'system', 'filetags');
$saved = PConfig::get(local_user(), 'system', 'filetags');
if (! strlen($saved)) {
return;
}
@ -182,7 +183,7 @@ function categories_widget($baseurl, $selected = '') {
return '';
}
$saved = get_pconfig($a->profile['profile_uid'], 'system', 'filetags');
$saved = PConfig::get($a->profile['profile_uid'], 'system', 'filetags');
if (! strlen($saved)) {
return;
}


+ 4
- 2
include/conversation.php View File

@ -1,6 +1,8 @@
<?php
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
require_once "include/bbcode.php";
@ -517,7 +519,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
$arr_blocked = null;
if (local_user()) {
$str_blocked = get_pconfig(local_user(), 'system', 'blocked');
$str_blocked = PConfig::get(local_user(), 'system', 'blocked');
if ($str_blocked) {
$arr_blocked = explode(',', $str_blocked);
for ($x = 0; $x < count($arr_blocked); $x ++) {
@ -1363,7 +1365,7 @@ function get_item_children($arr, $parent) {
$a = get_app();
foreach ($arr as $item) {
if ($item['id'] != $item['parent']) {
if (get_config('system', 'thread_allow') && $a->theme_thread_allow) {
if (Config::get('system', 'thread_allow') && $a->theme_thread_allow) {
// Fallback to parent-uri if thr-parent is not set
$thr_parent = $item['thr-parent'];
if ($thr_parent == '') {


+ 7
- 7
include/cron.php View File

@ -14,9 +14,9 @@ function cron_run(&$argv, &$argc){
return;
}
$last = get_config('system', 'last_cron');
$last = Config::get('system', 'last_cron');
$poll_interval = intval(get_config('system', 'cron_interval'));
$poll_interval = intval(Config::get('system', 'cron_interval'));
if (! $poll_interval) {
$poll_interval = 10;
}
@ -59,7 +59,7 @@ function cron_run(&$argv, &$argc){
Worker::add(PRIORITY_LOW, "cronjobs", "repair_database");
// once daily run birthday_updates and then expire in background
$d1 = get_config('system', 'last_expire_day');
$d1 = Config::get('system', 'last_expire_day');
$d2 = intval(datetime_convert('UTC', 'UTC', 'now', 'd'));
if ($d2 != intval($d1)) {
@ -70,7 +70,7 @@ function cron_run(&$argv, &$argc){
Worker::add(PRIORITY_LOW, "discover_poco", "suggestions");
set_config('system', 'last_expire_day', $d2);
Config::set('system', 'last_expire_day', $d2);
Worker::add(PRIORITY_LOW, 'expire');
@ -90,7 +90,7 @@ function cron_run(&$argv, &$argc){
logger('cron: end');
set_config('system', 'last_cron', time());
Config::set('system', 'last_cron', time());
return;
}
@ -135,7 +135,7 @@ function cron_poll_contacts($argc, $argv) {
// and which have a polling address and ignore Diaspora since
// we are unable to match those posts with a Diaspora GUID and prevent duplicates.
$abandon_days = intval(get_config('system', 'account_abandon_days'));
$abandon_days = intval(Config::get('system', 'account_abandon_days'));
if ($abandon_days < 1) {
$abandon_days = 0;
}
@ -194,7 +194,7 @@ function cron_poll_contacts($argc, $argv) {
* This also lets us update our subscription to the hub, and add or replace hubs in case it
* changed. We will only update hubs once a day, regardless of 'pushpoll_frequency'.
*/
$poll_interval = get_config('system', 'pushpoll_frequency');
$poll_interval = Config::get('system', 'pushpoll_frequency');
$contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
}


+ 4
- 4
include/cronhooks.php View File

@ -18,9 +18,9 @@ function cronhooks_run(&$argv, &$argc) {
return;
}
$last = get_config('system', 'last_cronhook');
$last = Config::get('system', 'last_cronhook');
$poll_interval = intval(get_config('system', 'cronhook_interval'));
$poll_interval = intval(Config::get('system', 'cronhook_interval'));
if (! $poll_interval) {
$poll_interval = 9;
}
@ -33,7 +33,7 @@ function cronhooks_run(&$argv, &$argc) {
}
}
$a->set_baseurl(get_config('system', 'url'));
$a->set_baseurl(Config::get('system', 'url'));
logger('cronhooks: start');
@ -48,7 +48,7 @@ function cronhooks_run(&$argv, &$argc) {
logger('cronhooks: end');
set_config('system', 'last_cronhook', time());
Config::set('system', 'last_cronhook', time());
return;
}

+ 6
- 6
include/cronjobs.php View File

@ -112,7 +112,7 @@ function cron_expire_and_remove_users() {
*/
function cron_clear_cache(App $a) {
$last = get_config('system','cache_last_cleared');
$last = Config::get('system','cache_last_cleared');
if ($last) {
$next = $last + (3600); // Once per hour
@ -138,10 +138,10 @@ function cron_clear_cache(App $a) {
clear_cache($a->get_basepath()."/view/smarty3/compiled", $a->get_basepath()."/view/smarty3/compiled");
// clear cache for image proxy
if (!get_config("system", "proxy_disabled")) {
if (!Config::get("system", "proxy_disabled")) {
clear_cache($a->get_basepath(), $a->get_basepath()."/proxy");
$cachetime = get_config('system','proxy_cache_time');
$cachetime = Config::get('system','proxy_cache_time');
if (!$cachetime) {
$cachetime = PROXY_DEFAULT_TIME;
}
@ -155,13 +155,13 @@ function cron_clear_cache(App $a) {
q("DELETE FROM `parsed_url` WHERE `created` < NOW() - INTERVAL 3 MONTH");
// Maximum table size in megabyte
$max_tablesize = intval(get_config('system','optimize_max_tablesize')) * 1000000;
$max_tablesize = intval(Config::get('system','optimize_max_tablesize')) * 1000000;
if ($max_tablesize == 0) {
$max_tablesize = 100 * 1000000; // Default are 100 MB
}
if ($max_tablesize > 0) {
// Minimum fragmentation level in percent
$fragmentation_level = intval(get_config('system','optimize_fragmentation')) / 100;
$fragmentation_level = intval(Config::get('system','optimize_fragmentation')) / 100;
if ($fragmentation_level == 0) {
$fragmentation_level = 0.3; // Default value is 30%
}
@ -196,7 +196,7 @@ function cron_clear_cache(App $a) {
}
}
set_config('system','cache_last_cleared', time());
Config::set('system','cache_last_cleared', time());
}
/**


+ 3
- 1
include/crypto.php View File

@ -1,5 +1,7 @@
<?php
use Friendica\Core\Config;
require_once 'library/ASNValue.class.php';
require_once 'library/asn1.php';
@ -146,7 +148,7 @@ function new_keypair($bits) {
'encrypt_key' => false
);
$conf = get_config('system', 'openssl_conf_file');
$conf = Config::get('system', 'openssl_conf_file');
if ($conf) {
$openssl_options['config'] = $conf;
}


+ 3
- 2
include/datetime.php View File

@ -5,6 +5,7 @@
*/
use Friendica\Core\Config;
use Friendica\Core\PConfig;
/**
* @brief Two-level sort for timezones.
@ -178,7 +179,7 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d
function dob($dob) {
list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d');
$f = get_config('system', 'birthday_input_format');
$f = Config::get('system', 'birthday_input_format');
if (! $f) {
$f = 'ymd';
}
@ -279,7 +280,7 @@ function timesel($format, $h, $m, $id = 'timepicker') {
function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
// First day of the week (0 = Sunday)
$firstDay = get_pconfig(local_user(), 'system', 'first_day_of_week');
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week');
if ($firstDay === false) {
$firstDay=0;
}


+ 3
- 3
include/dbstructure.php View File

@ -1781,9 +1781,9 @@ function dbstructure_run(&$argv, &$argc) {
case "update":
update_structure(true, true);
$build = get_config('system','build');
$build = Config::get('system','build');
if (!x($build)) {
set_config('system', 'build', DB_UPDATE_VERSION);
Config::set('system', 'build', DB_UPDATE_VERSION);
$build = DB_UPDATE_VERSION;
}
@ -1798,7 +1798,7 @@ function dbstructure_run(&$argv, &$argc) {
}
}
set_config('system','build',DB_UPDATE_VERSION);
Config::set('system','build',DB_UPDATE_VERSION);
return;
case "dumpsql":
print_structure(db_definition());


+ 4
- 4
include/delivery.php View File

@ -335,7 +335,7 @@ function delivery_run(&$argv, &$argc){
$x[0]['writable'] = 1;
}
$ssl_policy = get_config('system','ssl_policy');
$ssl_policy = Config::get('system','ssl_policy');
fix_contact_ssl_policy($x[0],$ssl_policy);
// If we are setup as a soapbox we aren't accepting top level posts from this person
@ -375,7 +375,7 @@ function delivery_run(&$argv, &$argc){
if ($owner['prvnets']) {
break;
}
if (get_config('system','ostatus_disabled') || get_config('system','dfrn_only')) {
if (Config::get('system','ostatus_disabled') || Config::get('system','dfrn_only')) {
break;
}
@ -386,7 +386,7 @@ function delivery_run(&$argv, &$argc){
case NETWORK_MAIL:
case NETWORK_MAIL2:
if (get_config('system','dfrn_only')) {
if (Config::get('system','dfrn_only')) {
break;
}
// WARNING: does not currently convert to RFC2047 header encodings, etc.
@ -489,7 +489,7 @@ function delivery_run(&$argv, &$argc){
logger('delivery: diaspora batch deliver: '.$loc);
if (get_config('system','dfrn_only') || (!get_config('system','diaspora_enabled')))
if (Config::get('system','dfrn_only') || (!Config::get('system','diaspora_enabled')))
break;
if ($mail) {


+ 7
- 6
include/dfrn.php View File

@ -8,6 +8,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
@ -442,11 +443,11 @@ class dfrn {
public static function relocate($owner, $uid) {
/* get site pubkey. this could be a new installation with no site keys*/
$pubkey = get_config('system','site_pubkey');
$pubkey = Config::get('system','site_pubkey');
if (! $pubkey) {
$res = new_keypair(1024);
set_config('system','site_prvkey', $res['prvkey']);
set_config('system','site_pubkey', $res['pubkey']);
Config::set('system','site_prvkey', $res['prvkey']);
Config::set('system','site_pubkey', $res['pubkey']);
}
$rp = q("SELECT `resource-id` , `scale`, type FROM `photo`
@ -478,7 +479,7 @@ class dfrn {
xml::add_element($doc, $relocate, "dfrn:confirm", $owner['confirm']);
xml::add_element($doc, $relocate, "dfrn:notify", $owner['notify']);
xml::add_element($doc, $relocate, "dfrn:poll", $owner['poll']);
xml::add_element($doc, $relocate, "dfrn:sitepubkey", get_config('system','site_pubkey'));
xml::add_element($doc, $relocate, "dfrn:sitepubkey", Config::get('system','site_pubkey'));
$root->appendChild($relocate);
@ -1103,12 +1104,12 @@ class dfrn {
$idtosend = '1:' . $orig_id;
}
$rino = get_config('system', 'rino_encrypt');
$rino = Config::get('system', 'rino_encrypt');
$rino = intval($rino);
logger("Local rino version: ". $rino, LOGGER_DEBUG);
$ssl_val = intval(get_config('system','ssl_policy'));
$ssl_val = intval(Config::get('system','ssl_policy'));
$ssl_policy = '';
switch ($ssl_val) {


+ 6
- 6
include/diaspora.php View File

@ -42,7 +42,7 @@ class Diaspora {
*/
public static function relay_list() {
$serverdata = get_config("system", "relay_server");
$serverdata = Config::get("system", "relay_server");
if ($serverdata == "")
return array();
@ -411,7 +411,7 @@ class Diaspora {
*/
public static function dispatch_public($msg) {
$enabled = intval(get_config("system", "diaspora_enabled"));
$enabled = intval(Config::get("system", "diaspora_enabled"));
if (!$enabled) {
logger("diaspora is disabled");
return false;
@ -740,7 +740,7 @@ class Diaspora {
if (!$person || $update) {
logger("create or refresh", LOGGER_DEBUG);
$r = probe_url($handle, PROBE_DIASPORA);
$r = Probe::uri($handle, NETWORK_DIASPORA);
// Note that Friendica contacts will return a "Diaspora person"
// if Diaspora connectivity is enabled on their server
@ -2151,7 +2151,7 @@ class Diaspora {
intval($importer["uid"])
);
if ($r && !$r[0]["hide-friends"] && !$contact["hidden"] && intval(get_pconfig($importer["uid"], "system", "post_newfriend"))) {
if ($r && !$r[0]["hide-friends"] && !$contact["hidden"] && intval(PConfig::get($importer["uid"], "system", "post_newfriend"))) {
$self = q("SELECT * FROM `contact` WHERE `self` AND `uid` = %d LIMIT 1",
intval($importer["uid"])
@ -2942,7 +2942,7 @@ class Diaspora {
$a = get_app();
$enabled = intval(get_config("system", "diaspora_enabled"));
$enabled = intval(Config::get("system", "diaspora_enabled"));
if (!$enabled)
return 200;
@ -2958,7 +2958,7 @@ class Diaspora {
if (!$queue_run && was_recently_delayed($contact["id"])) {
$return_code = 0;
} else {
if (!intval(get_config("system", "diaspora_test"))) {
if (!intval(Config::get("system", "diaspora_test"))) {
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
post_url($dest_url."/", $envelope, array("Content-Type: ".$content_type));


+ 7
- 6
include/discover_poco.php View File

@ -2,6 +2,7 @@
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Network\Probe;
require_once 'include/probe.php';
require_once 'include/socgraph.php';
@ -81,17 +82,17 @@ function discover_poco_run(&$argv, &$argc) {
logger($result, LOGGER_DEBUG);
} elseif ($mode == 3) {
update_suggestions();
} elseif (($mode == 2) && get_config('system','poco_completion')) {
} elseif (($mode == 2) && Config::get('system','poco_completion')) {
discover_users();
} elseif (($mode == 1) && ($search != "") && get_config('system','poco_local_search')) {
} elseif (($mode == 1) && ($search != "") && Config::get('system','poco_local_search')) {
discover_directory($search);
gs_search_user($search);
} elseif (($mode == 0) && ($search == "") && (get_config('system','poco_discovery') > 0)) {
} elseif (($mode == 0) && ($search == "") && (Config::get('system','poco_discovery') > 0)) {
// Query Friendica and Hubzilla servers for their users
poco_discover();
// Query GNU Social servers for their users ("statistics" addon has to be enabled on the GS server)
if (!get_config('system','ostatus_disabled'))
if (!Config::get('system','ostatus_disabled'))
gs_discover();
}
@ -234,7 +235,7 @@ function discover_directory($search) {
logger("Friendica server ".$server_url." seems to be okay.", LOGGER_DEBUG);
}
$data = probe_url($jj->url);
$data = Probe::uri($jj->url);
if ($data["network"] == NETWORK_DFRN) {
logger("Profile ".$jj->url." is reachable (".$search.")", LOGGER_DEBUG);
logger("Add profile ".$jj->url." to local directory (".$search.")", LOGGER_DEBUG);
@ -283,7 +284,7 @@ function gs_search_user($search) {
/// @TODO AS is considered as a notation for constants (as they usually being written all upper-case)
/// @TODO find all those and convert to all lower-case which is a keyword then
foreach ($contacts->data AS $user) {
$contact = probe_url($user->site_address."/".$user->name);
$contact = Probe::uri($user->site_address."/".$user->name);
if ($contact["network"] != NETWORK_PHANTOM) {
$contact["about"] = $user->description;
update_gcontact($contact);


+ 2
- 1
include/enotify.php View File

@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
require_once('include/Emailer.php');
@ -589,7 +590,7 @@ function notification($params) {
// check whether sending post content in email notifications is allowed
// always true for SYSTEM_EMAIL
$content_allowed = ((!get_config('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
$content_allowed = ((!Config::get('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
// load the template for private message notifications
$tpl = get_markup_template('email_notify_html.tpl');


+ 2
- 1
include/event.php View File

@ -5,6 +5,7 @@
*/
use Friendica\App;
use Friendica\Core\PConfig;
use Friendica\Core\System;
require_once 'include/bbcode.php';
@ -435,7 +436,7 @@ function event_store($arr) {
function get_event_strings() {
// First day of the week (0 = Sunday).
$firstDay = get_pconfig(local_user(), 'system', 'first_day_of_week');
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week');
if ($firstDay === false) {
$firstDay = 0;
}