function save() { $task = JCommentsInput::getVar('task'); $id = (int) JCommentsInput::getVar('id', 0); $bbcode =& JCommentsFactory::getBBCode(); $db =& JCommentsFactory::getDBO(); require_once JCOMMENTS_BASE . DS . 'jcomments.subscription.php'; $row = new JCommentsSubscriptionsDB($db); if ($id) { $row->load($id); } $row->object_id = (int) JCommentsInput::getVar('object_id'); $row->object_group = preg_replace('#[^0-9A-Za-z\\-\\_\\,\\.\\*]#is', '', trim(strip_tags(JCommentsInput::getVar('object_group')))); $row->name = preg_replace("/[\\'\"\\>\\<\\(\\)\\[\\]]?+/i", '', strip_tags(JCommentsInput::getVar('name'))); $row->email = trim(strip_tags(JCommentsInput::getVar('email'))); $row->store(); JCommentsCache::cleanCache('com_jcomments'); switch ($task) { case 'subscription.apply': JCommentsRedirect(JCOMMENTS_INDEX . '?option=com_jcomments&task=subscription.edit&hidemainmenu=1&cid[]=' . $row->id); break; case 'subscription.save': default: JCommentsRedirect(JCOMMENTS_INDEX . '?option=com_jcomments&task=subscriptions'); break; } }