aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-07-18 11:12:11 +0000
committerMario <mario@mariovavti.com>2023-07-18 11:12:11 +0000
commitda1ccc620b6bfe57c4dbcf9bbf6e8faecff881e3 (patch)
treecc6adb9645778aa39fabf79c4c5daf6140fffda4
parentc412c01a657fbac49f611b94b4c88cf63f4fff77 (diff)
parentba2d7752152ba061302db747780d157dfb3383d9 (diff)
downloadvolse-hubzilla-da1ccc620b6bfe57c4dbcf9bbf6e8faecff881e3.tar.gz
volse-hubzilla-da1ccc620b6bfe57c4dbcf9bbf6e8faecff881e3.tar.bz2
volse-hubzilla-da1ccc620b6bfe57c4dbcf9bbf6e8faecff881e3.zip
Merge branch 'DM42-20230717-fixfatalerron304' into 'dev'
Skip logging when DB functions are not yet loaded (logging requires db lookup). See merge request hubzilla/core!2051
-rw-r--r--boot.php4
-rw-r--r--include/network.php9
2 files changed, 7 insertions, 6 deletions
diff --git a/boot.php b/boot.php
index 18addbb6f..0013ef7c7 100644
--- a/boot.php
+++ b/boot.php
@@ -949,7 +949,7 @@ class App {
$staticfilecwd = getcwd();
$staticfilerealpath = realpath(self::$cmd);
if (strpos($staticfilerealpath, $staticfilecwd) !== 0) {
- http_status_exit(404, 'not found');
+ http_status_exit(404, 'not found', 1);
}
$staticfileetag = '"' . md5($staticfilerealpath . filemtime(self::$cmd)) . '"';
@@ -959,7 +959,7 @@ class App {
// If HTTP_IF_NONE_MATCH is same as the generated ETag => content is the same as browser cache
// So send a 304 Not Modified response header and exit
if ($_SERVER['HTTP_IF_NONE_MATCH'] == $staticfileetag) {
- http_status_exit(304, 'not modified');
+ http_status_exit(304, 'not modified', 1);
}
}
header("Content-type: " . $serve_rawfiles[$filext]);
diff --git a/include/network.php b/include/network.php
index b34fdffcc..d2b5a8b73 100644
--- a/include/network.php
+++ b/include/network.php
@@ -456,13 +456,14 @@ function as_return_and_die($obj,$channel) {
* @param string $msg
* optional message
*/
-function http_status($val, $msg = '') {
+function http_status($val, $msg = '',$skiplog = 0) {
if ($val >= 400)
$msg = (($msg) ? $msg : 'Error');
if ($val >= 200 && $val < 300)
$msg = (($msg) ? $msg : 'OK');
- logger(\App::$query_string . ':' . $val . ' ' . $msg);
+ if (!$skiplog)
+ logger(\App::$query_string . ':' . $val . ' ' . $msg);
header($_SERVER['SERVER_PROTOCOL'] . ' ' . $val . ' ' . $msg);
}
@@ -476,8 +477,8 @@ function http_status($val, $msg = '') {
* optional message
* @return void does not return, process is terminated
*/
-function http_status_exit($val, $msg = '') {
- http_status($val, $msg);
+function http_status_exit($val, $msg = '',$skiplog = 0) {
+ http_status($val, $msg, $skiplog);
killme();
}