diff --git a/include/client/open.inc.php b/include/client/open.inc.php index 53e0743e1d2e758d937c2fa1ca483310e5c565fe..ea0a100e7f67eeab48c0d1e61df43e14eda47f28 100644 --- a/include/client/open.inc.php +++ b/include/client/open.inc.php @@ -9,12 +9,13 @@ if($thisclient && $thisclient->isValid()) { $info=($_POST && $errors)?Format::htmlchars($_POST):$info; -if(array_key_exists('topicId',$_GET) && preg_match('/^\d+$/',$_GET['topicId'])) - $info['topicId'] = intval($_GET['topicId']); - $form = null; -if (!$info['topicId']) - $info['topicId'] = $cfg->getDefaultTopicId(); +if (!$info['topicId']) { + if (array_key_exists('topicId',$_GET) && preg_match('/^\d+$/',$_GET['topicId']) && Topic::lookup($_GET['topicId'])) + $info['topicId'] = intval($_GET['topicId']); + else + $info['topicId'] = $cfg->getDefaultTopicId(); +} if ($info['topicId'] && ($topic=Topic::lookup($info['topicId']))) { $form = $topic->getForm();