reply: share parent data from issue page
[minimedit.git] / widget / reply.php
index 4d504bbeb122c30ec7e4bb4888dbcfc32a57a785..4c7a3045d80ae11c7bf7bd6375214330e09b7ef1 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-global $User, $Db;
+global $User, $Db, $Issue;
 require_once 'database.inc.php';
 
 print '<h3>Reacties</h3>'."\n";
@@ -16,9 +16,10 @@ if ($_POST) {
                if (!$query->rowCount()) {
                        throw new Exception('Fout bij opslaan');
                }
-               if (@list ($cat, $issue) = explode('/', $Page) and ctype_digit($issue)) {
+
+               if (isset($Issue)) {
                        $row = ['updated' => ['now()']];
-                       $Db->set('issues', $row, ['page = ? AND id = ?', $cat, $issue]);
+                       $Db->set('issues', $row, ['id = ?', $Issue->id]);
                }
                $_POST['reply'] = NULL;
        }