<?php 
require("common_begin.php");

$commentID = $_GET['id'];
if (!isset($commentID))
  die("no comment ID set");
$replaceText = $_GET['text'];
if (!isset($replaceText))
  die("no text set");
  
$lst = Listopia::getInstance();

if ($lst->isLoggedIn() && $lst->isAdminUser())
{
  $userQuery = 'disc_id='.$commentID;
  $data = array(
    'disc_comment'           => htmlspecialchars($replaceText)
  );
  $okA = $lst->Database()->update('t_discussion', $data, $userQuery);
 
}