]*>(.*)]*>@i', $raw_post_data, $name)) {
preg_match('@]*>(.*)]*>@i', $raw_post_data, $name);
}
if (isset($name[1]) && !empty($name[1])) {
if (preg_match('@^(.*)\((.*)\)@i', $name[1], $names)) {
$comment['name'] = utf8_decode($names[2]);
$comment['email'] = utf8_decode($names[1]);
} else {
$comment['name'] = utf8_decode($name[1]);
}
}
if (preg_match('@]*>(.*)]*>@i', $raw_post_data, $link)) {
$comment['url'] = utf8_decode($link[1]);
}
if (preg_match('@]*>(.*)]*>@ims', $raw_post_data, $description)) {
if (preg_match('@^@ims', $description[1], $cdata)) {
$comment['comment'] = utf8_decode($cdata[1]);
} else {
$comment['comment'] = utf8_decode($description[1]);
}
if (!empty($comment['comment'])) {
serendipity_saveComment($_REQUEST['cid'], $comment, 'NORMAL', 'API');
}
}
}
?>