React to errors when comment could not be deleted (#527)

This commit is contained in:
onli 2018-06-12 23:49:11 +02:00
parent 4c671ead1c
commit 567587718b
2 changed files with 7 additions and 2 deletions

View File

@ -107,8 +107,12 @@ if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActio
/* We are asked to delete a comment */
if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'delete' && serendipity_checkFormToken()) {
serendipity_deleteComment($serendipity['GET']['id'], $serendipity['GET']['entry_id']);
$msg[] = DONE . ': '. sprintf(COMMENT_DELETED, (int)$serendipity['GET']['id']);
$success = serendipity_deleteComment($serendipity['GET']['id'], $serendipity['GET']['entry_id']);
if ($success === true) {
$msg[] = DONE . ': '. sprintf(COMMENT_DELETED, (int)$serendipity['GET']['id']);
} else {
$errormsg[] = ERROR . ': '. sprintf(COMMENT_NOT_DELETED, (int)$serendipity['GET']['id']);
}
}
/* We are either in edit mode, or preview mode */

View File

@ -1,2 +1,3 @@
@define('URL_NOT_FOUND', 'The requested page could not be found (404). This is the default page.');
@define('INSERT_ALL, 'Insert All');
@define('COMMENT_NOT_DELETED', 'Could not delete comment #%s .');