Increase error reporting and fix a few small warnings
Signed-off-by: Markus Birth <markus@birth-online.de>
This commit is contained in:
@ -843,7 +843,7 @@ function serendipity_getUriArguments($uri, $wildcard = false) {
|
|||||||
|
|
||||||
/* Explode the path into sections, to later be able to check for arguments and add our own */
|
/* Explode the path into sections, to later be able to check for arguments and add our own */
|
||||||
preg_match('/^'. preg_quote($serendipity['serendipityHTTPPath'], '/') . '(' . preg_quote($serendipity['indexFile'], '/') . '\?\/)?(' . ($wildcard ? '.+' : '[!;,_a-z0-9\-*\/%\+]+') . ')/i', $uri, $_res);
|
preg_match('/^'. preg_quote($serendipity['serendipityHTTPPath'], '/') . '(' . preg_quote($serendipity['indexFile'], '/') . '\?\/)?(' . ($wildcard ? '.+' : '[!;,_a-z0-9\-*\/%\+]+') . ')/i', $uri, $_res);
|
||||||
if (strlen($_res[2] ?? null) != 0) {
|
if (strlen($_res[2] ?? '') != 0) {
|
||||||
$args = explode('/', $_res[2]);
|
$args = explode('/', $_res[2]);
|
||||||
if ($args[0] == $indexFile || $args[0] == $serendipity['indexFile']) {
|
if ($args[0] == $indexFile || $args[0] == $serendipity['indexFile']) {
|
||||||
unset($args[0]);
|
unset($args[0]);
|
||||||
|
@ -1026,8 +1026,8 @@ function serendipity_smarty_init($vars = array()) {
|
|||||||
$serendipity['smarty_vars']['head_link_stylesheet'] .= '&v=' . ($serendipity['last_template_change'] ?? null);
|
$serendipity['smarty_vars']['head_link_stylesheet'] .= '&v=' . ($serendipity['last_template_change'] ?? null);
|
||||||
$serendipity['smarty_vars']['head_link_stylesheet_frontend'] .= '&v=' . ($serendipity['last_template_change'] ?? null);
|
$serendipity['smarty_vars']['head_link_stylesheet_frontend'] .= '&v=' . ($serendipity['last_template_change'] ?? null);
|
||||||
} else {
|
} else {
|
||||||
$serendipity['smarty_vars']['head_link_stylesheet'] .= '?v=' . $serendipity['last_template_change'];
|
$serendipity['smarty_vars']['head_link_stylesheet'] .= '?v=' . ($serendipity['last_template_change'] ?? '');
|
||||||
$serendipity['smarty_vars']['head_link_stylesheet_frontend'] .= '?v=' . $serendipity['last_template_change'];
|
$serendipity['smarty_vars']['head_link_stylesheet_frontend'] .= '?v=' . ($serendipity['last_template_change'] ?? '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1041,7 +1041,7 @@ function serendipity_smarty_init($vars = array()) {
|
|||||||
if (strstr($serendipity['smarty_vars']['head_link_script'], '?')) {
|
if (strstr($serendipity['smarty_vars']['head_link_script'], '?')) {
|
||||||
$serendipity['smarty_vars']['head_link_script'] .= '&v=' . ($serendipity['last_template_change'] ?? null);
|
$serendipity['smarty_vars']['head_link_script'] .= '&v=' . ($serendipity['last_template_change'] ?? null);
|
||||||
} else {
|
} else {
|
||||||
$serendipity['smarty_vars']['head_link_script'] .= '?v=' . $serendipity['last_template_change'];
|
$serendipity['smarty_vars']['head_link_script'] .= '?v=' . ($serendipity['last_template_change'] ?? '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class ConfigContainer implements ArrayAccess
|
|||||||
return isset($this->serendipity[$offset]);
|
return isset($this->serendipity[$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetGet($offset)
|
public function offsetGet(mixed $offset): mixed
|
||||||
{
|
{
|
||||||
return isset($this->serendipity[$offset]) ? $this->serendipity[$offset] : null;
|
return isset($this->serendipity[$offset]) ? $this->serendipity[$offset] : null;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,10 @@ class PdoSqliteDatabase extends DbAbstract
|
|||||||
// To fix that, we use a preg-regex; but that is quite performance costy.
|
// To fix that, we use a preg-regex; but that is quite performance costy.
|
||||||
// Either we always need to use 'SELECT a.id AS id, b.text AS text' in query,
|
// Either we always need to use 'SELECT a.id AS id, b.text AS text' in query,
|
||||||
// or the sqlite extension may get fixed. :-)
|
// or the sqlite extension may get fixed. :-)
|
||||||
$newrow[preg_replace('@^.+\.(.*)@', '\1', $i)] = str_replace($search, $replace, $v);
|
if (!is_null($v)) {
|
||||||
|
$v = str_replace($search, $replace, $v);
|
||||||
|
}
|
||||||
|
$newrow[preg_replace('@^.+\.(.*)@', '\1', $i)] = $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newrow;
|
return $newrow;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
namespace LuckyCoin;
|
namespace LuckyCoin;
|
||||||
|
|
||||||
// FIXME: Remove when code makes sense again
|
// FIXME: Remove when code makes sense again
|
||||||
error_reporting(E_ALL & ~E_NOTICE);
|
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED);
|
||||||
|
|
||||||
// Ensure vendor libraries exist
|
// Ensure vendor libraries exist
|
||||||
$autoload = __DIR__ . '/../vendor/autoload.php';
|
$autoload = __DIR__ . '/../vendor/autoload.php';
|
||||||
|
@ -29,7 +29,7 @@ if (!headers_sent() && php_sapi_name() !== 'cli') {
|
|||||||
session_regenerate_id(true);
|
session_regenerate_id(true);
|
||||||
@session_start();
|
@session_start();
|
||||||
header('X-Session-Reinit: true');
|
header('X-Session-Reinit: true');
|
||||||
$_SESSION['SERVER_GENERATED_SID'] = $_SERVER['REMOTE_ADDR'] . $_SERVER['QUERY_STRING'];
|
$_SESSION['SERVER_GENERATED_SID'] = $_SERVER['REMOTE_ADDR'] . ($_SERVER['QUERY_STRING'] ?? '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user