React to errors when comment could not be deleted (#527)
This commit is contained in:
parent
4c671ead1c
commit
567587718b
@ -107,8 +107,12 @@ if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActio
|
|||||||
|
|
||||||
/* We are asked to delete a comment */
|
/* We are asked to delete a comment */
|
||||||
if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'delete' && serendipity_checkFormToken()) {
|
if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'delete' && serendipity_checkFormToken()) {
|
||||||
serendipity_deleteComment($serendipity['GET']['id'], $serendipity['GET']['entry_id']);
|
$success = serendipity_deleteComment($serendipity['GET']['id'], $serendipity['GET']['entry_id']);
|
||||||
$msg[] = DONE . ': '. sprintf(COMMENT_DELETED, (int)$serendipity['GET']['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 */
|
/* We are either in edit mode, or preview mode */
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
@define('URL_NOT_FOUND', 'The requested page could not be found (404). This is the default page.');
|
@define('URL_NOT_FOUND', 'The requested page could not be found (404). This is the default page.');
|
||||||
@define('INSERT_ALL, 'Insert All');
|
@define('INSERT_ALL, 'Insert All');
|
||||||
|
@define('COMMENT_NOT_DELETED', 'Could not delete comment #%s .');
|
Loading…
x
Reference in New Issue
Block a user