From 11ad0acd289bbbf87081206e564da0874910a45e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 7 Oct 2019 14:10:30 -0400 Subject: [PATCH] Add accessor for App->args in App and BaseModule --- src/App.php | 10 ++++++++++ src/BaseModule.php | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/App.php b/src/App.php index c6ed818dd1..8a36c3bfeb 100644 --- a/src/App.php +++ b/src/App.php @@ -132,6 +132,16 @@ class App */ private $process; + /** + * Returns the arguments of the query + * + * @return Arguments + */ + public function getArgs() + { + return $this->args; + } + /** * Returns the current config cache of this node * diff --git a/src/BaseModule.php b/src/BaseModule.php index 0383487abd..76ed901110 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -120,7 +120,7 @@ abstract class BaseModule extends BaseObject $a = \get_app(); $x = explode('.', $hash); - if (time() > (IntVal($x[0]) + $max_livetime)) { + if (time() > (intval($x[0]) + $max_livetime)) { return false; } @@ -155,4 +155,12 @@ abstract class BaseModule extends BaseObject throw new \Friendica\Network\HTTPException\ForbiddenException(); } } + + /** + * @return App\Arguments + */ + protected static function getArgs() + { + return self::getApp()->getArgs(); + } }