From 7b1ea6cad6f714a669a1d0a8a1fea8c2bb3f3782 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 1 May 2019 21:17:03 -0400 Subject: [PATCH] Remove App->error --- mod/hcard.php | 1 - mod/notice.php | 1 - mod/viewsrc.php | 1 - src/App.php | 9 +-------- src/Model/Profile.php | 2 -- 5 files changed, 1 insertion(+), 13 deletions(-) diff --git a/mod/hcard.php b/mod/hcard.php index cbaebc8ff4..e27ea29be4 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -18,7 +18,6 @@ function hcard_init(App $a) $which = $a->argv[1]; } else { notice(L10n::t('No profile') . EOL); - $a->error = 404; return; } diff --git a/mod/notice.php b/mod/notice.php index 1a584000c7..edcbefdad2 100644 --- a/mod/notice.php +++ b/mod/notice.php @@ -16,7 +16,6 @@ function notice_init(App $a) $nick = $r[0]['nickname']; $a->internalRedirect('display/' . $nick . '/' . $id); } else { - $a->error = 404; notice(L10n::t('Item not found.') . EOL); } diff --git a/mod/viewsrc.php b/mod/viewsrc.php index f05996d2fb..939c73a142 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -18,7 +18,6 @@ function viewsrc_content(App $a) $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); if (!$item_id) { - $a->error = 404; notice(L10n::t('Item not found.') . EOL); return; } diff --git a/src/App.php b/src/App.php index 9cde124998..328a1a1522 100644 --- a/src/App.php +++ b/src/App.php @@ -49,7 +49,6 @@ class App public $page_contact; public $content; public $data = []; - public $error = false; public $cmd = ''; public $argv; public $argc; @@ -1252,9 +1251,7 @@ class App // "rawContent" is especially meant for technical endpoints. // This endpoint doesn't need any theme initialization or other comparable stuff. - if (!$this->error) { call_user_func([$this->module_class, 'rawContent']); - } } // Load current theme info after module has been initialized as theme could have been set in module @@ -1269,24 +1266,20 @@ class App } if ($this->module_class) { - if (! $this->error && $_SERVER['REQUEST_METHOD'] === 'POST') { + if ($_SERVER['REQUEST_METHOD'] === 'POST') { Core\Hook::callAll($this->module . '_mod_post', $_POST); call_user_func([$this->module_class, 'post']); } - if (! $this->error) { Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder); call_user_func([$this->module_class, 'afterpost']); - } - if (! $this->error) { $arr = ['content' => $content]; Core\Hook::callAll($this->module . '_mod_content', $arr); $content = $arr['content']; $arr = ['content' => call_user_func([$this->module_class, 'content'])]; Core\Hook::callAll($this->module . '_mod_aftercontent', $arr); $content .= $arr['content']; - } } // initialise content region diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 79971cd999..3c4ca6fed5 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -113,7 +113,6 @@ class Profile if (!DBA::isResult($user) && empty($profiledata)) { Logger::log('profile error: ' . $a->query_string, Logger::DEBUG); notice(L10n::t('Requested account is not available.') . EOL); - $a->error = 404; return; } @@ -131,7 +130,6 @@ class Profile if (empty($pdata) && empty($profiledata)) { Logger::log('profile error: ' . $a->query_string, Logger::DEBUG); notice(L10n::t('Requested profile is not available.') . EOL); - $a->error = 404; return; }