Commit 35677336 authored by CiaranG's avatar CiaranG

Catch bad replyto IDs before saving a new notice to avoid a constraint...

Catch bad replyto IDs before saving a new notice to avoid a constraint violation. This happens, for example, when posting for the first time on a fresh install
parent 3fd877c4
......@@ -152,6 +152,11 @@ class NewnoticeAction extends Action
}
$replyto = $this->trimmed('inreplyto');
#If an ID of 0 is wrongly passed here, it will cause a database error,
#so override it...
if ($replyto == 0) {
$replyto = 'false';
}
$notice = Notice::saveNew($user->id, $content, 'web', 1,
($replyto == 'false') ? null : $replyto);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment