Remove App->error
This commit is contained in:
parent
9b91b0550d
commit
7b1ea6cad6
|
@ -18,7 +18,6 @@ function hcard_init(App $a)
|
||||||
$which = $a->argv[1];
|
$which = $a->argv[1];
|
||||||
} else {
|
} else {
|
||||||
notice(L10n::t('No profile') . EOL);
|
notice(L10n::t('No profile') . EOL);
|
||||||
$a->error = 404;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ function notice_init(App $a)
|
||||||
$nick = $r[0]['nickname'];
|
$nick = $r[0]['nickname'];
|
||||||
$a->internalRedirect('display/' . $nick . '/' . $id);
|
$a->internalRedirect('display/' . $nick . '/' . $id);
|
||||||
} else {
|
} else {
|
||||||
$a->error = 404;
|
|
||||||
notice(L10n::t('Item not found.') . EOL);
|
notice(L10n::t('Item not found.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ function viewsrc_content(App $a)
|
||||||
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
|
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
|
||||||
|
|
||||||
if (!$item_id) {
|
if (!$item_id) {
|
||||||
$a->error = 404;
|
|
||||||
notice(L10n::t('Item not found.') . EOL);
|
notice(L10n::t('Item not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@ class App
|
||||||
public $page_contact;
|
public $page_contact;
|
||||||
public $content;
|
public $content;
|
||||||
public $data = [];
|
public $data = [];
|
||||||
public $error = false;
|
|
||||||
public $cmd = '';
|
public $cmd = '';
|
||||||
public $argv;
|
public $argv;
|
||||||
public $argc;
|
public $argc;
|
||||||
|
@ -1252,9 +1251,7 @@ class App
|
||||||
|
|
||||||
// "rawContent" is especially meant for technical endpoints.
|
// "rawContent" is especially meant for technical endpoints.
|
||||||
// This endpoint doesn't need any theme initialization or other comparable stuff.
|
// This endpoint doesn't need any theme initialization or other comparable stuff.
|
||||||
if (!$this->error) {
|
|
||||||
call_user_func([$this->module_class, 'rawContent']);
|
call_user_func([$this->module_class, 'rawContent']);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load current theme info after module has been initialized as theme could have been set in module
|
// 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->module_class) {
|
||||||
if (! $this->error && $_SERVER['REQUEST_METHOD'] === 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
Core\Hook::callAll($this->module . '_mod_post', $_POST);
|
Core\Hook::callAll($this->module . '_mod_post', $_POST);
|
||||||
call_user_func([$this->module_class, 'post']);
|
call_user_func([$this->module_class, 'post']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $this->error) {
|
|
||||||
Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
|
Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
|
||||||
call_user_func([$this->module_class, 'afterpost']);
|
call_user_func([$this->module_class, 'afterpost']);
|
||||||
}
|
|
||||||
|
|
||||||
if (! $this->error) {
|
|
||||||
$arr = ['content' => $content];
|
$arr = ['content' => $content];
|
||||||
Core\Hook::callAll($this->module . '_mod_content', $arr);
|
Core\Hook::callAll($this->module . '_mod_content', $arr);
|
||||||
$content = $arr['content'];
|
$content = $arr['content'];
|
||||||
$arr = ['content' => call_user_func([$this->module_class, 'content'])];
|
$arr = ['content' => call_user_func([$this->module_class, 'content'])];
|
||||||
Core\Hook::callAll($this->module . '_mod_aftercontent', $arr);
|
Core\Hook::callAll($this->module . '_mod_aftercontent', $arr);
|
||||||
$content .= $arr['content'];
|
$content .= $arr['content'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialise content region
|
// initialise content region
|
||||||
|
|
|
@ -113,7 +113,6 @@ class Profile
|
||||||
if (!DBA::isResult($user) && empty($profiledata)) {
|
if (!DBA::isResult($user) && empty($profiledata)) {
|
||||||
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
|
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
|
||||||
notice(L10n::t('Requested account is not available.') . EOL);
|
notice(L10n::t('Requested account is not available.') . EOL);
|
||||||
$a->error = 404;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +130,6 @@ class Profile
|
||||||
if (empty($pdata) && empty($profiledata)) {
|
if (empty($pdata) && empty($profiledata)) {
|
||||||
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
|
Logger::log('profile error: ' . $a->query_string, Logger::DEBUG);
|
||||||
notice(L10n::t('Requested profile is not available.') . EOL);
|
notice(L10n::t('Requested profile is not available.') . EOL);
|
||||||
$a->error = 404;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue