mirror of
https://github.com/friendica/friendica
synced 2025-04-19 09:10:12 +00:00
Escape global namespaced get_app() calls
- Add deprecated status
This commit is contained in:
parent
b8030313e5
commit
5e1ceb57de
52 changed files with 135 additions and 133 deletions
|
@ -88,7 +88,7 @@ abstract class BaseModule extends BaseObject
|
|||
*/
|
||||
public static function getFormSecurityToken($typename = '')
|
||||
{
|
||||
$a = get_app();
|
||||
$a = \get_app();
|
||||
|
||||
$timestamp = time();
|
||||
$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
|
||||
|
||||
$a = get_app();
|
||||
$a = \get_app();
|
||||
|
||||
$x = explode('.', $hash);
|
||||
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')
|
||||
{
|
||||
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: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
|
||||
notice(self::getFormSecurityStandardErrorMessage());
|
||||
|
@ -147,7 +147,7 @@ abstract class BaseModule extends BaseObject
|
|||
public static function checkFormSecurityTokenForbiddenOnError($typename = '', $formname = 'form_security_token')
|
||||
{
|
||||
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: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
|
||||
header('HTTP/1.1 403 Forbidden');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue