From 1514fdaead46043823d297f546a54234a5883a1e Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 25 Mar 2017 12:59:37 +0100 Subject: [PATCH] rewrote to static approach and if() condition can be simplified. Signed-off-by: Roland Haeder --- boot.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/boot.php b/boot.php index 0efd4a2069..2a6e9b4ca5 100644 --- a/boot.php +++ b/boot.php @@ -1255,8 +1255,7 @@ class App { * @return bool Is it a known backend? */ function is_backend() { - /// @Should be made static to speedup things - $backend = array(); + static $backend = array(); $backend[] = "_well_known"; $backend[] = "api"; $backend[] = "dfrn_notify"; @@ -1277,12 +1276,8 @@ class App { $backend[] = "statistics_json"; $backend[] = "xrd"; - /// @TODO Maybe rewrite this part: return (in_array() || $this->backend); ? - if (in_array($this->module, $backend)) { - return(true); - } else { - return($this->backend); - } + // Check if current module is in backend or backend flag is set + return (in_array($this->module, self::$backend) || $this->backend); } /** -- 2.39.5