Escape global namespaced get_app() calls
- Add deprecated status
This commit is contained in:
parent
b8030313e5
commit
5e1ceb57de
10
boot.php
10
boot.php
|
@ -327,6 +327,8 @@ if (!defined('CURLE_OPERATION_TIMEDOUT')) {
|
||||||
*
|
*
|
||||||
* Useful in functions which require it but don't get it passed to them
|
* Useful in functions which require it but don't get it passed to them
|
||||||
*
|
*
|
||||||
|
* @deprecated since version 2018.09
|
||||||
|
* @see BaseObject::getApp()
|
||||||
* @return App
|
* @return App
|
||||||
*/
|
*/
|
||||||
function get_app()
|
function get_app()
|
||||||
|
@ -457,7 +459,7 @@ function notice($s)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
if (empty($_SESSION['sysmsg'])) {
|
if (empty($_SESSION['sysmsg'])) {
|
||||||
$_SESSION['sysmsg'] = [];
|
$_SESSION['sysmsg'] = [];
|
||||||
}
|
}
|
||||||
|
@ -475,7 +477,7 @@ function notice($s)
|
||||||
*/
|
*/
|
||||||
function info($s)
|
function info($s)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) {
|
if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) {
|
||||||
return;
|
return;
|
||||||
|
@ -538,7 +540,7 @@ function feed_birthday($uid, $tz)
|
||||||
*/
|
*/
|
||||||
function is_site_admin()
|
function is_site_admin()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$admin_email = Config::get('config', 'admin_email');
|
$admin_email = Config::get('config', 'admin_email');
|
||||||
|
|
||||||
|
@ -647,7 +649,7 @@ function get_server()
|
||||||
|
|
||||||
function get_temppath()
|
function get_temppath()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$temppath = Config::get("system", "temppath");
|
$temppath = Config::get("system", "temppath");
|
||||||
|
|
||||||
|
|
|
@ -430,7 +430,7 @@ function api_call(App $a)
|
||||||
*/
|
*/
|
||||||
function api_error($type, $e)
|
function api_error($type, $e)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$error = ($e->getMessage() !== "" ? $e->getMessage() : $e->httpdesc);
|
$error = ($e->getMessage() !== "" ? $e->getMessage() : $e->httpdesc);
|
||||||
/// @TODO: https://dev.twitter.com/overview/api/response-codes
|
/// @TODO: https://dev.twitter.com/overview/api/response-codes
|
||||||
|
@ -963,7 +963,7 @@ function api_format_data($root_element, $type, $data)
|
||||||
function api_account_verify_credentials($type)
|
function api_account_verify_credentials($type)
|
||||||
{
|
{
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -1027,7 +1027,7 @@ function requestdata($k)
|
||||||
*/
|
*/
|
||||||
function api_statuses_mediap($type)
|
function api_statuses_mediap($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
Logger::log('api_statuses_update: no user');
|
Logger::log('api_statuses_update: no user');
|
||||||
|
@ -1075,7 +1075,7 @@ api_register_func('api/statuses/mediap', 'api_statuses_mediap', true, API_METHOD
|
||||||
*/
|
*/
|
||||||
function api_statuses_update($type)
|
function api_statuses_update($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
Logger::log('api_statuses_update: no user');
|
Logger::log('api_statuses_update: no user');
|
||||||
|
@ -1217,7 +1217,7 @@ api_register_func('api/statuses/update_with_media', 'api_statuses_update', true,
|
||||||
*/
|
*/
|
||||||
function api_media_upload()
|
function api_media_upload()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
Logger::log('no user');
|
Logger::log('no user');
|
||||||
|
@ -1261,7 +1261,7 @@ api_register_func('api/media/upload', 'api_media_upload', true, API_METHOD_POST)
|
||||||
*/
|
*/
|
||||||
function api_status_show($type, $item_id = 0)
|
function api_status_show($type, $item_id = 0)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
|
@ -1360,7 +1360,7 @@ function api_status_show($type, $item_id = 0)
|
||||||
*/
|
*/
|
||||||
function api_users_show($type)
|
function api_users_show($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
|
@ -1436,7 +1436,7 @@ api_register_func('api/externalprofile/show', 'api_users_show');
|
||||||
*/
|
*/
|
||||||
function api_users_search($type)
|
function api_users_search($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$userlist = [];
|
$userlist = [];
|
||||||
|
|
||||||
|
@ -1516,7 +1516,7 @@ api_register_func('api/users/lookup', 'api_users_lookup', true);
|
||||||
*/
|
*/
|
||||||
function api_search($type)
|
function api_search($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -1577,7 +1577,7 @@ api_register_func('api/search', 'api_search', true);
|
||||||
*/
|
*/
|
||||||
function api_statuses_home_timeline($type)
|
function api_statuses_home_timeline($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -1665,7 +1665,7 @@ api_register_func('api/statuses/friends_timeline', 'api_statuses_home_timeline',
|
||||||
*/
|
*/
|
||||||
function api_statuses_public_timeline($type)
|
function api_statuses_public_timeline($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -1747,7 +1747,7 @@ api_register_func('api/statuses/public_timeline', 'api_statuses_public_timeline'
|
||||||
*/
|
*/
|
||||||
function api_statuses_networkpublic_timeline($type)
|
function api_statuses_networkpublic_timeline($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -1802,7 +1802,7 @@ api_register_func('api/statuses/networkpublic_timeline', 'api_statuses_networkpu
|
||||||
*/
|
*/
|
||||||
function api_statuses_show($type)
|
function api_statuses_show($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -1875,7 +1875,7 @@ api_register_func('api/statuses/show', 'api_statuses_show', true);
|
||||||
*/
|
*/
|
||||||
function api_conversation_show($type)
|
function api_conversation_show($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -1954,7 +1954,7 @@ function api_statuses_repeat($type)
|
||||||
{
|
{
|
||||||
global $called_api;
|
global $called_api;
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -2019,7 +2019,7 @@ api_register_func('api/statuses/retweet', 'api_statuses_repeat', true, API_METHO
|
||||||
*/
|
*/
|
||||||
function api_statuses_destroy($type)
|
function api_statuses_destroy($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -2060,7 +2060,7 @@ api_register_func('api/statuses/destroy', 'api_statuses_destroy', true, API_METH
|
||||||
*/
|
*/
|
||||||
function api_statuses_mentions($type)
|
function api_statuses_mentions($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -2128,7 +2128,7 @@ api_register_func('api/statuses/replies', 'api_statuses_mentions', true);
|
||||||
*/
|
*/
|
||||||
function api_statuses_user_timeline($type)
|
function api_statuses_user_timeline($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -2206,7 +2206,7 @@ api_register_func('api/statuses/user_timeline', 'api_statuses_user_timeline', tr
|
||||||
*/
|
*/
|
||||||
function api_favorites_create_destroy($type)
|
function api_favorites_create_destroy($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -2284,7 +2284,7 @@ function api_favorites($type)
|
||||||
{
|
{
|
||||||
global $called_api;
|
global $called_api;
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -2737,7 +2737,7 @@ function api_contactlink_to_array($txt)
|
||||||
*/
|
*/
|
||||||
function api_format_items_activities($item, $type = "json")
|
function api_format_items_activities($item, $type = "json")
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$activities = [
|
$activities = [
|
||||||
'like' => [],
|
'like' => [],
|
||||||
|
@ -2859,7 +2859,7 @@ function api_format_items_profiles($profile_row)
|
||||||
*/
|
*/
|
||||||
function api_format_items($r, $user_info, $filter_user = false, $type = "json")
|
function api_format_items($r, $user_info, $filter_user = false, $type = "json")
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
|
@ -3049,7 +3049,7 @@ api_register_func('api/lists/subscriptions', 'api_lists_list', true);
|
||||||
*/
|
*/
|
||||||
function api_lists_ownerships($type)
|
function api_lists_ownerships($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -3093,7 +3093,7 @@ api_register_func('api/lists/ownerships', 'api_lists_ownerships', true);
|
||||||
*/
|
*/
|
||||||
function api_lists_statuses($type)
|
function api_lists_statuses($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -3170,7 +3170,7 @@ api_register_func('api/lists/statuses', 'api_lists_statuses', true);
|
||||||
*/
|
*/
|
||||||
function api_statuses_f($qtype)
|
function api_statuses_f($qtype)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -3346,7 +3346,7 @@ api_register_func('api/friendships/incoming', 'api_friendships_incoming', true);
|
||||||
*/
|
*/
|
||||||
function api_statusnet_config($type)
|
function api_statusnet_config($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$name = Config::get('config', 'sitename');
|
$name = Config::get('config', 'sitename');
|
||||||
$server = $a->getHostName();
|
$server = $a->getHostName();
|
||||||
|
@ -3410,7 +3410,7 @@ function api_ff_ids($type)
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
api_get_user($a);
|
api_get_user($a);
|
||||||
|
|
||||||
|
@ -3478,7 +3478,7 @@ api_register_func('api/followers/ids', 'api_followers_ids', true);
|
||||||
*/
|
*/
|
||||||
function api_direct_messages_new($type)
|
function api_direct_messages_new($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -3566,7 +3566,7 @@ api_register_func('api/direct_messages/new', 'api_direct_messages_new', true, AP
|
||||||
*/
|
*/
|
||||||
function api_direct_messages_destroy($type)
|
function api_direct_messages_destroy($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -3724,7 +3724,7 @@ api_register_func('api/friendships/destroy', 'api_friendships_destroy', true, AP
|
||||||
*/
|
*/
|
||||||
function api_direct_messages_box($type, $box, $verbose)
|
function api_direct_messages_box($type, $box, $verbose)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
}
|
}
|
||||||
|
@ -4353,7 +4353,7 @@ function api_account_update_profile_image($type)
|
||||||
Contact::updateSelfFromUserID(api_user(), true);
|
Contact::updateSelfFromUserID(api_user(), true);
|
||||||
|
|
||||||
// Update global directory in background
|
// Update global directory in background
|
||||||
$url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
|
$url = System::baseUrl() . '/profile/' . \get_app()->user['nickname'];
|
||||||
if ($url && strlen(Config::get('system', 'directory'))) {
|
if ($url && strlen(Config::get('system', 'directory'))) {
|
||||||
Worker::add(PRIORITY_LOW, "Directory", $url);
|
Worker::add(PRIORITY_LOW, "Directory", $url);
|
||||||
}
|
}
|
||||||
|
@ -4668,7 +4668,7 @@ function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $f
|
||||||
*/
|
*/
|
||||||
function prepare_photo_data($type, $scale, $photo_id)
|
function prepare_photo_data($type, $scale, $photo_id)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if ($user_info === false) {
|
if ($user_info === false) {
|
||||||
|
@ -5209,7 +5209,7 @@ function api_best_nickname(&$contacts)
|
||||||
*/
|
*/
|
||||||
function api_friendica_group_show($type)
|
function api_friendica_group_show($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5274,7 +5274,7 @@ api_register_func('api/friendica/group_show', 'api_friendica_group_show', true);
|
||||||
*/
|
*/
|
||||||
function api_friendica_group_delete($type)
|
function api_friendica_group_delete($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5336,7 +5336,7 @@ api_register_func('api/friendica/group_delete', 'api_friendica_group_delete', tr
|
||||||
*/
|
*/
|
||||||
function api_lists_destroy($type)
|
function api_lists_destroy($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5452,7 +5452,7 @@ function group_create($name, $uid, $users = [])
|
||||||
*/
|
*/
|
||||||
function api_friendica_group_create($type)
|
function api_friendica_group_create($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5481,7 +5481,7 @@ api_register_func('api/friendica/group_create', 'api_friendica_group_create', tr
|
||||||
*/
|
*/
|
||||||
function api_lists_create($type)
|
function api_lists_create($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5515,7 +5515,7 @@ api_register_func('api/lists/create', 'api_lists_create', true, API_METHOD_POST)
|
||||||
*/
|
*/
|
||||||
function api_friendica_group_update($type)
|
function api_friendica_group_update($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5589,7 +5589,7 @@ api_register_func('api/friendica/group_update', 'api_friendica_group_update', tr
|
||||||
*/
|
*/
|
||||||
function api_lists_update($type)
|
function api_lists_update($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5635,7 +5635,7 @@ api_register_func('api/lists/update', 'api_lists_update', true, API_METHOD_POST)
|
||||||
*/
|
*/
|
||||||
function api_friendica_activity($type)
|
function api_friendica_activity($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5679,7 +5679,7 @@ api_register_func('api/friendica/activity/unattendmaybe', 'api_friendica_activit
|
||||||
*/
|
*/
|
||||||
function api_friendica_notification($type)
|
function api_friendica_notification($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5715,7 +5715,7 @@ function api_friendica_notification($type)
|
||||||
*/
|
*/
|
||||||
function api_friendica_notification_seen($type)
|
function api_friendica_notification_seen($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$user_info = api_get_user($a);
|
$user_info = api_get_user($a);
|
||||||
|
|
||||||
if (api_user() === false || $user_info === false) {
|
if (api_user() === false || $user_info === false) {
|
||||||
|
@ -5760,7 +5760,7 @@ api_register_func('api/friendica/notification', 'api_friendica_notification', tr
|
||||||
*/
|
*/
|
||||||
function api_friendica_direct_messages_setseen($type)
|
function api_friendica_direct_messages_setseen($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
}
|
}
|
||||||
|
@ -5809,7 +5809,7 @@ api_register_func('api/friendica/direct_messages_setseen', 'api_friendica_direct
|
||||||
*/
|
*/
|
||||||
function api_friendica_direct_messages_search($type, $box = "")
|
function api_friendica_direct_messages_search($type, $box = "")
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
@ -5872,7 +5872,7 @@ api_register_func('api/friendica/direct_messages_search', 'api_friendica_direct_
|
||||||
*/
|
*/
|
||||||
function api_friendica_profile_show($type)
|
function api_friendica_profile_show($type)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (api_user() === false) {
|
if (api_user() === false) {
|
||||||
throw new ForbiddenException();
|
throw new ForbiddenException();
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
function notification($params)
|
function notification($params)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// Temporary logging for finding the origin
|
// Temporary logging for finding the origin
|
||||||
if (!isset($params['language']) || !isset($params['uid'])) {
|
if (!isset($params['language']) || !isset($params['uid'])) {
|
||||||
|
|
|
@ -72,7 +72,7 @@ function fbrowser_content(App $a)
|
||||||
|
|
||||||
function _map_files1($rr)
|
function _map_files1($rr)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$types = Image::supportedTypes();
|
$types = Image::supportedTypes();
|
||||||
$ext = $types[$rr['type']];
|
$ext = $types[$rr['type']];
|
||||||
$filename_e = $rr['filename'];
|
$filename_e = $rr['filename'];
|
||||||
|
@ -116,7 +116,7 @@ function fbrowser_content(App $a)
|
||||||
|
|
||||||
function _map_files2($rr)
|
function _map_files2($rr)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
list($m1,$m2) = explode("/", $rr['filetype']);
|
list($m1,$m2) = explode("/", $rr['filetype']);
|
||||||
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
|
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
|
||||||
$filename_e = $rr['filename'];
|
$filename_e = $rr['filename'];
|
||||||
|
|
|
@ -853,7 +853,7 @@ function item_post(App $a) {
|
||||||
function item_post_return($baseurl, $api_source, $return_path)
|
function item_post_return($baseurl, $api_source, $return_path)
|
||||||
{
|
{
|
||||||
// figure out how to return, depending on from whence we came
|
// figure out how to return, depending on from whence we came
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if ($api_source) {
|
if ($api_source) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -127,7 +127,7 @@ function lostpass_form()
|
||||||
function lostpass_generate_password($user)
|
function lostpass_generate_password($user)
|
||||||
{
|
{
|
||||||
$o = '';
|
$o = '';
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$new_password = User::generateNewPassword();
|
$new_password = User::generateNewPassword();
|
||||||
$result = User::updatePassword($user['uid'], $new_password);
|
$result = User::updatePassword($user['uid'], $new_password);
|
||||||
|
|
|
@ -502,7 +502,7 @@ function get_messages($uid, $start, $limit)
|
||||||
|
|
||||||
function render_messages(array $msg, $t)
|
function render_messages(array $msg, $t)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate($t);
|
$tpl = Renderer::getMarkupTemplate($t);
|
||||||
$rslt = '';
|
$rslt = '';
|
||||||
|
|
|
@ -145,7 +145,7 @@ function nodeinfo_init(App $a) {
|
||||||
|
|
||||||
function nodeinfo_cron() {
|
function nodeinfo_cron() {
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// If the addon 'statistics_json' is enabled then disable it and activate nodeinfo.
|
// If the addon 'statistics_json' is enabled then disable it and activate nodeinfo.
|
||||||
if (Addon::isEnabled('statistics_json')) {
|
if (Addon::isEnabled('statistics_json')) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ function ostatus_subscribe_content(App $a)
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = local_user();
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$counter = intval($_REQUEST['counter']);
|
$counter = intval($_REQUEST['counter']);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Friendica\Module\Login;
|
||||||
|
|
||||||
function user_allow($hash)
|
function user_allow($hash)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$register = Register::getByHash($hash);
|
$register = Register::getByHash($hash);
|
||||||
if (!DBA::isResult($register)) {
|
if (!DBA::isResult($register)) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ function repair_ostatus_content(App $a) {
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = local_user();
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$counter = intval($_REQUEST['counter']);
|
$counter = intval($_REQUEST['counter']);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Util\Temporal;
|
||||||
|
|
||||||
function get_theme_config_file($theme)
|
function get_theme_config_file($theme)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$base_theme = defaults($a->theme_info, 'extends');
|
$base_theme = defaults($a->theme_info, 'extends');
|
||||||
|
|
||||||
if (file_exists("view/theme/$theme/config.php")) {
|
if (file_exists("view/theme/$theme/config.php")) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ abstract class BaseModule extends BaseObject
|
||||||
*/
|
*/
|
||||||
public static function getFormSecurityToken($typename = '')
|
public static function getFormSecurityToken($typename = '')
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $timestamp . $typename);
|
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $timestamp . $typename);
|
||||||
|
@ -116,7 +116,7 @@ abstract class BaseModule extends BaseObject
|
||||||
|
|
||||||
$max_livetime = 10800; // 3 hours
|
$max_livetime = 10800; // 3 hours
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$x = explode('.', $hash);
|
$x = explode('.', $hash);
|
||||||
if (time() > (IntVal($x[0]) + $max_livetime)) {
|
if (time() > (IntVal($x[0]) + $max_livetime)) {
|
||||||
|
@ -136,7 +136,7 @@ abstract class BaseModule extends BaseObject
|
||||||
public static function checkFormSecurityTokenRedirectOnError($err_redirect, $typename = '', $formname = 'form_security_token')
|
public static function checkFormSecurityTokenRedirectOnError($err_redirect, $typename = '', $formname = 'form_security_token')
|
||||||
{
|
{
|
||||||
if (!self::checkFormSecurityToken($typename, $formname)) {
|
if (!self::checkFormSecurityToken($typename, $formname)) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
|
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
|
||||||
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
|
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
|
||||||
notice(self::getFormSecurityStandardErrorMessage());
|
notice(self::getFormSecurityStandardErrorMessage());
|
||||||
|
@ -147,7 +147,7 @@ abstract class BaseModule extends BaseObject
|
||||||
public static function checkFormSecurityTokenForbiddenOnError($typename = '', $formname = 'form_security_token')
|
public static function checkFormSecurityTokenForbiddenOnError($typename = '', $formname = 'form_security_token')
|
||||||
{
|
{
|
||||||
if (!self::checkFormSecurityToken($typename, $formname)) {
|
if (!self::checkFormSecurityToken($typename, $formname)) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
|
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
|
||||||
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
|
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
|
||||||
header('HTTP/1.1 403 Forbidden');
|
header('HTTP/1.1 403 Forbidden');
|
||||||
|
|
|
@ -56,7 +56,7 @@ class OEmbed
|
||||||
{
|
{
|
||||||
$embedurl = trim($embedurl, '\'"');
|
$embedurl = trim($embedurl, '\'"');
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$cache_key = 'oembed:' . $a->videowidth . ':' . $embedurl;
|
$cache_key = 'oembed:' . $a->videowidth . ':' . $embedurl;
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ class OEmbed
|
||||||
*/
|
*/
|
||||||
private static function iframe($src, $width, $height)
|
private static function iframe($src, $width, $height)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!$height || strstr($height, '%')) {
|
if (!$height || strstr($height, '%')) {
|
||||||
$height = '200';
|
$height = '200';
|
||||||
|
|
|
@ -811,7 +811,7 @@ class HTML
|
||||||
public static function contactBlock()
|
public static function contactBlock()
|
||||||
{
|
{
|
||||||
$o = '';
|
$o = '';
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$shown = PConfig::get($a->profile['uid'], 'system', 'display_friend_count', 24);
|
$shown = PConfig::get($a->profile['uid'], 'system', 'display_friend_count', 24);
|
||||||
if ($shown == 0) {
|
if ($shown == 0) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Widget
|
||||||
*/
|
*/
|
||||||
public static function findPeople()
|
public static function findPeople()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$global_dir = Config::get('system', 'directory');
|
$global_dir = Config::get('system', 'directory');
|
||||||
|
|
||||||
if (Config::get('system', 'invitation_only')) {
|
if (Config::get('system', 'invitation_only')) {
|
||||||
|
@ -207,7 +207,7 @@ class Widget
|
||||||
*/
|
*/
|
||||||
public static function categories($baseurl, $selected = '')
|
public static function categories($baseurl, $selected = '')
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!Feature::isEnabled($a->profile['profile_uid'], 'categories')) {
|
if (!Feature::isEnabled($a->profile['profile_uid'], 'categories')) {
|
||||||
return '';
|
return '';
|
||||||
|
@ -316,7 +316,7 @@ class Widget
|
||||||
*/
|
*/
|
||||||
public static function tagCloud($limit = 50)
|
public static function tagCloud($limit = 50)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!$a->profile['profile_uid'] || !$a->profile['url']) {
|
if (!$a->profile['profile_uid'] || !$a->profile['url']) {
|
||||||
return '';
|
return '';
|
||||||
|
|
|
@ -23,7 +23,7 @@ class CalendarExport
|
||||||
* @return string Formated HTML of the calendar widget.
|
* @return string Formated HTML of the calendar widget.
|
||||||
*/
|
*/
|
||||||
public static function getHTML() {
|
public static function getHTML() {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (empty($a->data['user'])) {
|
if (empty($a->data['user'])) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -59,7 +59,7 @@ HELP;
|
||||||
throw new \RuntimeException('DocBlox isn\'t available.');
|
throw new \RuntimeException('DocBlox isn\'t available.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = get_app()->getBasePath();
|
$dir = \get_app()->getBasePath();
|
||||||
|
|
||||||
//stack for dirs to search
|
//stack for dirs to search
|
||||||
$dirstack = [];
|
$dirstack = [];
|
||||||
|
|
|
@ -39,7 +39,7 @@ HELP;
|
||||||
|
|
||||||
protected function doExecute()
|
protected function doExecute()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if ($this->getOption('v')) {
|
if ($this->getOption('v')) {
|
||||||
$this->out('Class: ' . __CLASS__);
|
$this->out('Class: ' . __CLASS__);
|
||||||
|
|
|
@ -47,7 +47,7 @@ HELP;
|
||||||
|
|
||||||
protected function doExecute()
|
protected function doExecute()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if ($this->getOption('v')) {
|
if ($this->getOption('v')) {
|
||||||
$this->out('Class: ' . __CLASS__);
|
$this->out('Class: ' . __CLASS__);
|
||||||
|
|
|
@ -40,7 +40,7 @@ HELP;
|
||||||
|
|
||||||
protected function doExecute()
|
protected function doExecute()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if ($this->getOption('v')) {
|
if ($this->getOption('v')) {
|
||||||
$this->out('Class: ' . __CLASS__);
|
$this->out('Class: ' . __CLASS__);
|
||||||
|
|
|
@ -51,7 +51,7 @@ HELP;
|
||||||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$phpfile = realpath($this->getArgument(0));
|
$phpfile = realpath($this->getArgument(0));
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ HELP;
|
||||||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$pofile = realpath($this->getArgument(0));
|
$pofile = realpath($this->getArgument(0));
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ HELP;
|
||||||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$php_path = $a->getConfigValue('config', 'php_path', 'php');
|
$php_path = $a->getConfigValue('config', 'php_path', 'php');
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Theme
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$stamp1 = microtime(true);
|
$stamp1 = microtime(true);
|
||||||
$theme_file = file_get_contents("view/theme/$theme/theme.php");
|
$theme_file = file_get_contents("view/theme/$theme/theme.php");
|
||||||
$a->saveTimestamp($stamp1, "file");
|
$a->saveTimestamp($stamp1, "file");
|
||||||
|
@ -155,13 +155,13 @@ class Theme
|
||||||
if ($root !== '' && $root[strlen($root) - 1] !== '/') {
|
if ($root !== '' && $root[strlen($root) - 1] !== '/') {
|
||||||
$root = $root . '/';
|
$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)) {
|
if (is_array($theme_info) && array_key_exists('extends', $theme_info)) {
|
||||||
$parent = $theme_info['extends'];
|
$parent = $theme_info['extends'];
|
||||||
} else {
|
} else {
|
||||||
$parent = 'NOPATH';
|
$parent = 'NOPATH';
|
||||||
}
|
}
|
||||||
$theme = get_app()->getCurrentTheme();
|
$theme = \get_app()->getCurrentTheme();
|
||||||
$thname = $theme;
|
$thname = $theme;
|
||||||
$ext = substr($file, strrpos($file, '.') + 1);
|
$ext = substr($file, strrpos($file, '.') + 1);
|
||||||
$paths = [
|
$paths = [
|
||||||
|
@ -191,7 +191,7 @@ class Theme
|
||||||
*/
|
*/
|
||||||
public static function getStylesheetPath($theme)
|
public static function getStylesheetPath($theme)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
|
$opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
|
||||||
if (file_exists('view/theme/' . $theme . '/style.php')) {
|
if (file_exists('view/theme/' . $theme . '/style.php')) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Worker
|
||||||
*/
|
*/
|
||||||
public static function processQueue($run_cron = true)
|
public static function processQueue($run_cron = true)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
self::$up_start = microtime(true);
|
self::$up_start = microtime(true);
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ class Worker
|
||||||
*/
|
*/
|
||||||
public static function execute($queue)
|
public static function execute($queue)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$mypid = getmypid();
|
$mypid = getmypid();
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ class Worker
|
||||||
*/
|
*/
|
||||||
private static function execFunction($queue, $funcname, $argv, $method_call)
|
private static function execFunction($queue, $funcname, $argv, $method_call)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$mypid = getmypid();
|
$mypid = getmypid();
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ class DBA
|
||||||
* @param string $query The database query that will be analyzed
|
* @param string $query The database query that will be analyzed
|
||||||
*/
|
*/
|
||||||
private static function logIndex($query) {
|
private static function logIndex($query) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!$a->getConfigVariable('system', 'db_log_index')) {
|
if (!$a->getConfigVariable('system', 'db_log_index')) {
|
||||||
return;
|
return;
|
||||||
|
@ -388,7 +388,7 @@ class DBA
|
||||||
* @return bool|object statement object or result object
|
* @return bool|object statement object or result object
|
||||||
*/
|
*/
|
||||||
public static function p($sql) {
|
public static function p($sql) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$stamp1 = microtime(true);
|
$stamp1 = microtime(true);
|
||||||
|
|
||||||
|
@ -606,7 +606,7 @@ class DBA
|
||||||
* @return boolean Was the query successfull? False is returned only if an error occurred
|
* @return boolean Was the query successfull? False is returned only if an error occurred
|
||||||
*/
|
*/
|
||||||
public static function e($sql) {
|
public static function e($sql) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$stamp = microtime(true);
|
$stamp = microtime(true);
|
||||||
|
|
||||||
|
@ -770,7 +770,7 @@ class DBA
|
||||||
* @return array current row
|
* @return array current row
|
||||||
*/
|
*/
|
||||||
public static function fetch($stmt) {
|
public static function fetch($stmt) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$stamp1 = microtime(true);
|
$stamp1 = microtime(true);
|
||||||
|
|
||||||
|
@ -1518,7 +1518,7 @@ class DBA
|
||||||
* @return boolean was the close successful?
|
* @return boolean was the close successful?
|
||||||
*/
|
*/
|
||||||
public static function close($stmt) {
|
public static function close($stmt) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$stamp1 = microtime(true);
|
$stamp1 = microtime(true);
|
||||||
|
|
||||||
|
|
|
@ -909,7 +909,7 @@ class Contact extends BaseObject
|
||||||
public static function photoMenu(array $contact, $uid = 0)
|
public static function photoMenu(array $contact, $uid = 0)
|
||||||
{
|
{
|
||||||
// @todo Unused, to be removed
|
// @todo Unused, to be removed
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$contact_url = '';
|
$contact_url = '';
|
||||||
$pm_url = '';
|
$pm_url = '';
|
||||||
|
@ -1631,7 +1631,7 @@ class Contact extends BaseObject
|
||||||
{
|
{
|
||||||
$result = ['cid' => -1, 'success' => false, 'message' => ''];
|
$result = ['cid' => -1, 'success' => false, 'message' => ''];
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// remove ajax junk, e.g. Twitter
|
// remove ajax junk, e.g. Twitter
|
||||||
$url = str_replace('/#!/', '/', $url);
|
$url = str_replace('/#!/', '/', $url);
|
||||||
|
|
|
@ -518,7 +518,7 @@ class GContact
|
||||||
*/
|
*/
|
||||||
public static function updateSuggestions()
|
public static function updateSuggestions()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$done = [];
|
$done = [];
|
||||||
|
|
||||||
|
|
|
@ -1148,7 +1148,7 @@ class Item extends BaseObject
|
||||||
if ($notify) {
|
if ($notify) {
|
||||||
// We have to avoid duplicates. So we create the GUID in form of a hash of the plink or uri.
|
// We have to avoid duplicates. So we create the GUID in form of a hash of the plink or uri.
|
||||||
// We add the hash of our own host because our host is the original creator of the post.
|
// We add the hash of our own host because our host is the original creator of the post.
|
||||||
$prefix_host = get_app()->getHostName();
|
$prefix_host = \get_app()->getHostName();
|
||||||
} else {
|
} else {
|
||||||
$prefix_host = '';
|
$prefix_host = '';
|
||||||
|
|
||||||
|
@ -1238,7 +1238,7 @@ class Item extends BaseObject
|
||||||
|
|
||||||
public static function insert($item, $force_parent = false, $notify = false, $dontcache = false)
|
public static function insert($item, $force_parent = false, $notify = false, $dontcache = false)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// If it is a posting where users should get notifications, then define it as wall posting
|
// If it is a posting where users should get notifications, then define it as wall posting
|
||||||
if ($notify) {
|
if ($notify) {
|
||||||
|
@ -2611,7 +2611,7 @@ class Item extends BaseObject
|
||||||
|
|
||||||
public static function isRemoteSelf($contact, &$datarray)
|
public static function isRemoteSelf($contact, &$datarray)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!$contact['remote_self']) {
|
if (!$contact['remote_self']) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -28,7 +28,7 @@ class Mail
|
||||||
*/
|
*/
|
||||||
public static function send($recipient = 0, $body = '', $subject = '', $replyto = '')
|
public static function send($recipient = 0, $body = '', $subject = '', $replyto = '')
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!$recipient) {
|
if (!$recipient) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -144,7 +144,7 @@ class Photo
|
||||||
$micro = System::baseUrl() . '/photo/' . $hash . '-6.' . $Image->getExt() . $suffix;
|
$micro = System::baseUrl() . '/photo/' . $hash . '-6.' . $Image->getExt() . $suffix;
|
||||||
|
|
||||||
// Remove the cached photo
|
// Remove the cached photo
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$basepath = $a->getBasePath();
|
$basepath = $a->getBasePath();
|
||||||
|
|
||||||
if (is_dir($basepath . "/photo")) {
|
if (is_dir($basepath . "/photo")) {
|
||||||
|
|
|
@ -280,7 +280,7 @@ class Profile
|
||||||
*/
|
*/
|
||||||
private static function sidebar($profile, $block = 0, $show_connect = true)
|
private static function sidebar($profile, $block = 0, $show_connect = true)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
$location = false;
|
$location = false;
|
||||||
|
@ -551,7 +551,7 @@ class Profile
|
||||||
|
|
||||||
public static function getBirthdays()
|
public static function getBirthdays()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
if (!local_user() || $a->is_mobile || $a->is_tablet) {
|
if (!local_user() || $a->is_mobile || $a->is_tablet) {
|
||||||
|
@ -649,7 +649,7 @@ class Profile
|
||||||
|
|
||||||
public static function getEventsReminderHTML()
|
public static function getEventsReminderHTML()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
if (!local_user() || $a->is_mobile || $a->is_tablet) {
|
if (!local_user() || $a->is_mobile || $a->is_tablet) {
|
||||||
|
@ -1090,7 +1090,7 @@ class Profile
|
||||||
*/
|
*/
|
||||||
public static function openWebAuthInit($token)
|
public static function openWebAuthInit($token)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// Clean old OpenWebAuthToken entries.
|
// Clean old OpenWebAuthToken entries.
|
||||||
OpenWebAuthToken::purge('owt', '3 MINUTE');
|
OpenWebAuthToken::purge('owt', '3 MINUTE');
|
||||||
|
|
|
@ -406,7 +406,7 @@ class User
|
||||||
*/
|
*/
|
||||||
public static function create(array $data)
|
public static function create(array $data)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$return = ['user' => null, 'password' => ''];
|
$return = ['user' => null, 'password' => ''];
|
||||||
|
|
||||||
$using_invites = Config::get('system', 'invitation_only');
|
$using_invites = Config::get('system', 'invitation_only');
|
||||||
|
@ -795,7 +795,7 @@ class User
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
Logger::log('Removing user: ' . $uid);
|
Logger::log('Removing user: ' . $uid);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class FKOAuth1 extends OAuthServer
|
||||||
public function loginUser($uid)
|
public function loginUser($uid)
|
||||||
{
|
{
|
||||||
Logger::log("FKOAuth1::loginUser $uid");
|
Logger::log("FKOAuth1::loginUser $uid");
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$record = DBA::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]);
|
$record = DBA::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]);
|
||||||
|
|
||||||
if (!DBA::isResult($record)) {
|
if (!DBA::isResult($record)) {
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Probe
|
||||||
*/
|
*/
|
||||||
private static function ownHost($host)
|
private static function ownHost($host)
|
||||||
{
|
{
|
||||||
$own_host = get_app()->getHostName();
|
$own_host = \get_app()->getHostName();
|
||||||
|
|
||||||
$parts = parse_url($host);
|
$parts = parse_url($host);
|
||||||
|
|
||||||
|
|
|
@ -652,7 +652,7 @@ class Image
|
||||||
|
|
||||||
$string = $this->asString();
|
$string = $this->asString();
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$stamp1 = microtime(true);
|
$stamp1 = microtime(true);
|
||||||
file_put_contents($path, $string);
|
file_put_contents($path, $string);
|
||||||
|
@ -730,7 +730,7 @@ class Image
|
||||||
Logger::log('Image: guessType: '.$filename . ($fromcurl?' from curl headers':''), Logger::DEBUG);
|
Logger::log('Image: guessType: '.$filename . ($fromcurl?' from curl headers':''), Logger::DEBUG);
|
||||||
$type = null;
|
$type = null;
|
||||||
if ($fromcurl) {
|
if ($fromcurl) {
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$headers=[];
|
$headers=[];
|
||||||
$h = explode("\n", $header);
|
$h = explode("\n", $header);
|
||||||
foreach ($h as $l) {
|
foreach ($h as $l) {
|
||||||
|
@ -798,7 +798,7 @@ class Image
|
||||||
} else {
|
} else {
|
||||||
$tempfile = tempnam(get_temppath(), "cache");
|
$tempfile = tempnam(get_temppath(), "cache");
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$stamp1 = microtime(true);
|
$stamp1 = microtime(true);
|
||||||
file_put_contents($tempfile, $img_str);
|
file_put_contents($tempfile, $img_str);
|
||||||
$a->saveTimestamp($stamp1, "file");
|
$a->saveTimestamp($stamp1, "file");
|
||||||
|
|
|
@ -137,7 +137,7 @@ class DFRN
|
||||||
*/
|
*/
|
||||||
public static function feed($dfrn_id, $owner_nick, $last_update, $direction = 0, $onlyheader = false)
|
public static function feed($dfrn_id, $owner_nick, $last_update, $direction = 0, $onlyheader = false)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$sitefeed = ((strlen($owner_nick)) ? false : true); // not yet implemented, need to rewrite huge chunks of following logic
|
$sitefeed = ((strlen($owner_nick)) ? false : true); // not yet implemented, need to rewrite huge chunks of following logic
|
||||||
$public_feed = (($dfrn_id) ? false : true);
|
$public_feed = (($dfrn_id) ? false : true);
|
||||||
|
@ -1160,7 +1160,7 @@ class DFRN
|
||||||
*/
|
*/
|
||||||
public static function deliver($owner, $contact, $atom, $dissolve = false, $legacy_transport = false)
|
public static function deliver($owner, $contact, $atom, $dissolve = false, $legacy_transport = false)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// At first try the Diaspora transport layer
|
// At first try the Diaspora transport layer
|
||||||
if (!$dissolve && !$legacy_transport) {
|
if (!$dissolve && !$legacy_transport) {
|
||||||
|
@ -1420,7 +1420,7 @@ class DFRN
|
||||||
*/
|
*/
|
||||||
public static function transmit($owner, $contact, $atom, $public_batch = false)
|
public static function transmit($owner, $contact, $atom, $public_batch = false)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!$public_batch) {
|
if (!$public_batch) {
|
||||||
if (empty($contact['addr'])) {
|
if (empty($contact['addr'])) {
|
||||||
|
@ -1894,7 +1894,7 @@ class DFRN
|
||||||
*/
|
*/
|
||||||
private static function processSuggestion($xpath, $suggestion, $importer)
|
private static function processSuggestion($xpath, $suggestion, $importer)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
Logger::log("Processing suggestions");
|
Logger::log("Processing suggestions");
|
||||||
|
|
||||||
|
@ -2457,7 +2457,7 @@ class DFRN
|
||||||
|
|
||||||
/// @todo Do we really need this check for HTML elements? (It was copied from the old function)
|
/// @todo Do we really need this check for HTML elements? (It was copied from the old function)
|
||||||
if ((strpos($item['body'], '<') !== false) && (strpos($item['body'], '>') !== false)) {
|
if ((strpos($item['body'], '<') !== false) && (strpos($item['body'], '>') !== false)) {
|
||||||
$base_url = get_app()->getBaseURL();
|
$base_url = \get_app()->getBaseURL();
|
||||||
$item['body'] = HTML::relToAbs($item['body'], $base_url);
|
$item['body'] = HTML::relToAbs($item['body'], $base_url);
|
||||||
|
|
||||||
$item['body'] = HTML::toBBCodeVideo($item['body']);
|
$item['body'] = HTML::toBBCodeVideo($item['body']);
|
||||||
|
|
|
@ -2305,7 +2305,7 @@ class Diaspora
|
||||||
*/
|
*/
|
||||||
private static function receiveRequestMakeFriend(array $importer, array $contact)
|
private static function receiveRequestMakeFriend(array $importer, array $contact)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if ($contact["rel"] == Contact::SHARING) {
|
if ($contact["rel"] == Contact::SHARING) {
|
||||||
DBA::update(
|
DBA::update(
|
||||||
|
@ -3064,7 +3064,7 @@ class Diaspora
|
||||||
*/
|
*/
|
||||||
public static function transmit(array $owner, array $contact, $envelope, $public_batch, $queue_run = false, $guid = "", $no_queue = false)
|
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"));
|
$enabled = intval(Config::get("system", "diaspora_enabled"));
|
||||||
if (!$enabled) {
|
if (!$enabled) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Feed {
|
||||||
*/
|
*/
|
||||||
public static function import($xml, $importer, &$contact, &$hub, $simulate = false) {
|
public static function import($xml, $importer, &$contact, &$hub, $simulate = false) {
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if (!$simulate) {
|
if (!$simulate) {
|
||||||
Logger::log("Import Atom/RSS feed '".$contact["name"]."' (Contact ".$contact["id"].") for user ".$importer["uid"], Logger::DEBUG);
|
Logger::log("Import Atom/RSS feed '".$contact["name"]."' (Contact ".$contact["id"].") for user ".$importer["uid"], Logger::DEBUG);
|
||||||
|
|
|
@ -1266,7 +1266,7 @@ class OStatus
|
||||||
*/
|
*/
|
||||||
private static function addHeader(DOMDocument $doc, array $owner, $filter, $feed_mode = false)
|
private static function addHeader(DOMDocument $doc, array $owner, $filter, $feed_mode = false)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$root = $doc->createElementNS(NAMESPACE_ATOM1, 'feed');
|
$root = $doc->createElementNS(NAMESPACE_ATOM1, 'feed');
|
||||||
$doc->appendChild($root);
|
$doc->appendChild($root);
|
||||||
|
|
|
@ -63,7 +63,7 @@ class PortableContact
|
||||||
*/
|
*/
|
||||||
public static function load($cid, $uid, $zcid, $url)
|
public static function load($cid, $uid, $zcid, $url)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
if ($cid) {
|
if ($cid) {
|
||||||
if (!$url || !$uid) {
|
if (!$url || !$uid) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ class FriendicaSmarty extends Smarty
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$theme = $a->getCurrentTheme();
|
$theme = $a->getCurrentTheme();
|
||||||
|
|
||||||
// setTemplateDir can be set to an array, which Smarty will parse in order.
|
// setTemplateDir can be set to an array, which Smarty will parse in order.
|
||||||
|
|
|
@ -32,7 +32,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
|
||||||
$s = new FriendicaSmarty();
|
$s = new FriendicaSmarty();
|
||||||
}
|
}
|
||||||
|
|
||||||
$r['$APP'] = get_app();
|
$r['$APP'] = \get_app();
|
||||||
|
|
||||||
// "middleware": inject variables into templates
|
// "middleware": inject variables into templates
|
||||||
$arr = [
|
$arr = [
|
||||||
|
@ -54,7 +54,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
|
||||||
|
|
||||||
public function getTemplateFile($file, $root = '')
|
public function getTemplateFile($file, $root = '')
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$template = new FriendicaSmarty();
|
$template = new FriendicaSmarty();
|
||||||
|
|
||||||
// Make sure $root ends with a slash /
|
// Make sure $root ends with a slash /
|
||||||
|
|
|
@ -122,7 +122,7 @@ class ExAuth
|
||||||
*/
|
*/
|
||||||
private function isUser(array $aCommand)
|
private function isUser(array $aCommand)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// Check if there is a username
|
// Check if there is a username
|
||||||
if (!isset($aCommand[1])) {
|
if (!isset($aCommand[1])) {
|
||||||
|
@ -202,7 +202,7 @@ class ExAuth
|
||||||
*/
|
*/
|
||||||
private function auth(array $aCommand)
|
private function auth(array $aCommand)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
// check user authentication
|
// check user authentication
|
||||||
if (sizeof($aCommand) != 4) {
|
if (sizeof($aCommand) != 4) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ class Network
|
||||||
|
|
||||||
$stamp1 = microtime(true);
|
$stamp1 = microtime(true);
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$parts = parse_url($url);
|
$parts = parse_url($url);
|
||||||
$path_parts = explode('/', defaults($parts, 'path', ''));
|
$path_parts = explode('/', defaults($parts, 'path', ''));
|
||||||
|
@ -251,7 +251,7 @@ class Network
|
||||||
return CurlResult::createErrorCurl($url);
|
return CurlResult::createErrorCurl($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
|
|
||||||
if (($redirects > 8) || (!$ch)) {
|
if (($redirects > 8) || (!$ch)) {
|
||||||
|
@ -604,7 +604,7 @@ class Network
|
||||||
*/
|
*/
|
||||||
public static function finalUrl($url, $depth = 1, $fetchbody = false)
|
public static function finalUrl($url, $depth = 1, $fetchbody = false)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$url = self::stripTrackingQueryParams($url);
|
$url = self::stripTrackingQueryParams($url);
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ class ParseUrl
|
||||||
*/
|
*/
|
||||||
public static function getSiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1)
|
public static function getSiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$siteinfo = [];
|
$siteinfo = [];
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Temporal
|
||||||
*/
|
*/
|
||||||
public static function getDateofBirthField($dob)
|
public static function getDateofBirthField($dob)
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
|
list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
|
||||||
|
|
||||||
|
|
|
@ -1242,7 +1242,7 @@ class ApiTest extends DatabaseTest
|
||||||
'type' => 'image/png'
|
'type' => 'image/png'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
$app = get_app();
|
$app = \get_app();
|
||||||
$app->argc = 2;
|
$app->argc = 2;
|
||||||
|
|
||||||
$result = api_media_upload();
|
$result = api_media_upload();
|
||||||
|
|
|
@ -21,7 +21,7 @@ use Friendica\Core\PConfig;
|
||||||
|
|
||||||
function get_scheme_info($scheme)
|
function get_scheme_info($scheme)
|
||||||
{
|
{
|
||||||
$theme = get_app()->getCurrentTheme();
|
$theme = \get_app()->getCurrentTheme();
|
||||||
$themepath = 'view/theme/' . $theme . '/';
|
$themepath = 'view/theme/' . $theme . '/';
|
||||||
$scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'scheme'));
|
$scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'scheme'));
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ if (! function_exists('_js_in_foot')) {
|
||||||
function _js_in_foot() {
|
function _js_in_foot() {
|
||||||
/** @purpose insert stuff in bottom of page
|
/** @purpose insert stuff in bottom of page
|
||||||
*/
|
*/
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
$ssl_state = null;
|
$ssl_state = null;
|
||||||
$baseurl = System::baseUrl($ssl_state);
|
$baseurl = System::baseUrl($ssl_state);
|
||||||
$bottom['$baseurl'] = $baseurl;
|
$bottom['$baseurl'] = $baseurl;
|
||||||
|
|
|
@ -129,7 +129,7 @@ function get_vier_config($key, $default = false, $admin = false)
|
||||||
|
|
||||||
function vier_community_info()
|
function vier_community_info()
|
||||||
{
|
{
|
||||||
$a = get_app();
|
$a = \get_app();
|
||||||
|
|
||||||
$show_pages = get_vier_config("show_pages", 1);
|
$show_pages = get_vier_config("show_pages", 1);
|
||||||
$show_profiles = get_vier_config("show_profiles", 1);
|
$show_profiles = get_vier_config("show_profiles", 1);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user