Fixed various oversights.
This commit is contained in:
parent
107d16cf46
commit
9bb943bacf
6 changed files with 16 additions and 12 deletions
|
@ -12,11 +12,9 @@ use Misuzu\Pagination;
|
||||||
use Misuzu\Users\UserInfo;
|
use Misuzu\Users\UserInfo;
|
||||||
|
|
||||||
class ForumCategories {
|
class ForumCategories {
|
||||||
private IDbConnection $dbConn;
|
|
||||||
private DbStatementCache $cache;
|
private DbStatementCache $cache;
|
||||||
|
|
||||||
public function __construct(IDbConnection $dbConn) {
|
public function __construct(IDbConnection $dbConn) {
|
||||||
$this->dbConn = $dbConn;
|
|
||||||
$this->cache = new DbStatementCache($dbConn);
|
$this->cache = new DbStatementCache($dbConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ use Misuzu\Users\UserInfo;
|
||||||
class MessagesDatabase {
|
class MessagesDatabase {
|
||||||
private DbStatementCache $cache;
|
private DbStatementCache $cache;
|
||||||
|
|
||||||
public function __construct(private IDbConnection $dbConn) {
|
public function __construct(IDbConnection $dbConn) {
|
||||||
$this->cache = new DbStatementCache($dbConn);
|
$this->cache = new DbStatementCache($dbConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -556,9 +556,9 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return 400;
|
return 400;
|
||||||
|
|
||||||
$content = $request->getContent();
|
$content = $request->getContent();
|
||||||
$messages = explode(',', (string)$content->getParam('messages'));
|
|
||||||
|
|
||||||
if(empty($messages))
|
$messages = (string)$content->getParam('messages');
|
||||||
|
if($messages === '')
|
||||||
return [
|
return [
|
||||||
'error' => [
|
'error' => [
|
||||||
'name' => 'msgs:empty',
|
'name' => 'msgs:empty',
|
||||||
|
@ -566,6 +566,8 @@ class MessagesRoutes extends RouteHandler {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$messages = explode(',', $messages);
|
||||||
|
|
||||||
$this->msgsCtx->getDatabase()->deleteMessages(
|
$this->msgsCtx->getDatabase()->deleteMessages(
|
||||||
$this->authInfo->getUserInfo(),
|
$this->authInfo->getUserInfo(),
|
||||||
$messages
|
$messages
|
||||||
|
@ -581,9 +583,9 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return 400;
|
return 400;
|
||||||
|
|
||||||
$content = $request->getContent();
|
$content = $request->getContent();
|
||||||
$messages = explode(',', (string)$content->getParam('messages'));
|
|
||||||
|
|
||||||
if(empty($messages))
|
$messages = (string)$content->getParam('messages');
|
||||||
|
if($messages === '')
|
||||||
return [
|
return [
|
||||||
'error' => [
|
'error' => [
|
||||||
'name' => 'msgs:empty',
|
'name' => 'msgs:empty',
|
||||||
|
@ -591,6 +593,8 @@ class MessagesRoutes extends RouteHandler {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$messages = explode(',', $messages);
|
||||||
|
|
||||||
$this->msgsCtx->getDatabase()->restoreMessages(
|
$this->msgsCtx->getDatabase()->restoreMessages(
|
||||||
$this->authInfo->getUserInfo(),
|
$this->authInfo->getUserInfo(),
|
||||||
$messages
|
$messages
|
||||||
|
@ -606,9 +610,9 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return 400;
|
return 400;
|
||||||
|
|
||||||
$content = $request->getContent();
|
$content = $request->getContent();
|
||||||
$messages = explode(',', (string)$content->getParam('messages'));
|
|
||||||
|
|
||||||
if(empty($messages))
|
$messages = (string)$content->getParam('messages');
|
||||||
|
if($messages === '')
|
||||||
return [
|
return [
|
||||||
'error' => [
|
'error' => [
|
||||||
'name' => 'msgs:empty',
|
'name' => 'msgs:empty',
|
||||||
|
@ -616,6 +620,8 @@ class MessagesRoutes extends RouteHandler {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$messages = explode(',', $messages);
|
||||||
|
|
||||||
$this->msgsCtx->getDatabase()->nukeMessages(
|
$this->msgsCtx->getDatabase()->nukeMessages(
|
||||||
$this->authInfo->getUserInfo(),
|
$this->authInfo->getUserInfo(),
|
||||||
$messages
|
$messages
|
||||||
|
|
|
@ -14,7 +14,7 @@ class RoutingErrorHandler extends HtmlErrorHandler {
|
||||||
|
|
||||||
if($code === 500 || $code === 503) {
|
if($code === 500 || $code === 503) {
|
||||||
$response->setTypeHTML();
|
$response->setTypeHTML();
|
||||||
$response->setContent(file_get_contents('%s/%03d.html', MSZ_TEMPLATES, $code));
|
$response->setContent(file_get_contents(sprintf('%s/%03d.html', MSZ_TEMPLATES, $code)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ModNoteInfo {
|
||||||
return new ModNoteInfo(
|
return new ModNoteInfo(
|
||||||
noteId: $result->getString(0),
|
noteId: $result->getString(0),
|
||||||
userId: $result->getString(1),
|
userId: $result->getString(1),
|
||||||
authorId: $result->getIntegerOrNull(2),
|
authorId: $result->getStringOrNull(2),
|
||||||
created: $result->getInteger(3),
|
created: $result->getInteger(3),
|
||||||
title: $result->getString(4),
|
title: $result->getString(4),
|
||||||
body: $result->getString(5)
|
body: $result->getString(5)
|
||||||
|
|
|
@ -47,7 +47,7 @@ class UserInfo {
|
||||||
created: $result->getInteger(9),
|
created: $result->getInteger(9),
|
||||||
lastActive: $result->getIntegerOrNull(10),
|
lastActive: $result->getIntegerOrNull(10),
|
||||||
deleted: $result->getIntegerOrNull(11),
|
deleted: $result->getIntegerOrNull(11),
|
||||||
displayRoleId: $result->getIntegerOrNull(12),
|
displayRoleId: $result->getStringOrNull(12),
|
||||||
totpKey: $result->getStringOrNull(13),
|
totpKey: $result->getStringOrNull(13),
|
||||||
aboutContent: $result->getStringOrNull(14),
|
aboutContent: $result->getStringOrNull(14),
|
||||||
aboutParser: $result->getInteger(15),
|
aboutParser: $result->getInteger(15),
|
||||||
|
|
Loading…
Reference in a new issue