[ Index ] |
|
Code source de Serendipity 1.2 |
1 <?php # $Id: wfwcomment.php 1055 2006-04-06 09:14:11Z garvinhicking $ 2 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) 3 # All rights reserved. See LICENSE file for licensing details 4 5 include ('serendipity_config.inc.php'); 6 7 if ($_REQUEST['cid'] != '' && $HTTP_RAW_POST_DATA != '') { 8 $comment = array(); 9 10 if (!preg_match('@<author[^>]*>(.*)</author[^>]*>@i', $HTTP_RAW_POST_DATA, $name)) { 11 preg_match('@<dc:creator[^>]*>(.*)</dc:creator[^>]*>@i', $HTTP_RAW_POST_DATA, $name); 12 } 13 14 if (isset($name[1]) && !empty($name[1])) { 15 if (preg_match('@^(.*)\((.*)\)@i', $name[1], $names)) { 16 $comment['name'] = utf8_decode($names[2]); 17 $comment['email'] = utf8_decode($names[1]); 18 } else { 19 $comment['name'] = utf8_decode($name[1]); 20 } 21 } 22 23 if (preg_match('@<link[^>]*>(.*)</link[^>]*>@i', $HTTP_RAW_POST_DATA, $link)) { 24 $comment['url'] = utf8_decode($link[1]); 25 } 26 27 if (preg_match('@<description[^>]*>(.*)</description[^>]*>@ims', $HTTP_RAW_POST_DATA, $description)) { 28 if (preg_match('@^<!\[CDATA\[(.*)\]\]>@ims', $description[1], $cdata)) { 29 $comment['comment'] = utf8_decode($cdata[1]); 30 } else { 31 $comment['comment'] = utf8_decode($description[1]); 32 } 33 34 if (!empty($comment['comment'])) { 35 serendipity_saveComment($_REQUEST['cid'], $comment, 'NORMAL', 'API'); 36 } 37 } 38 } 39 40 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Nov 24 09:00:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |