Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21590
Modified Files:
wfwcomment.php
Log Message:
Make comments via wfw:comment API utf8-clean for storage in DB.
Index: wfwcomment.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/wfwcomment.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- wfwcomment.php 6 Feb 2004 21:56:21 -0000 1.1
+++ wfwcomment.php 17 Feb 2004 10:43:15 -0000 1.2
@@ -14,22 +14,22 @@
if (isset($name[1]) && !empty($name[1])) {
if (preg_match('@^(.*)\((.*)\)@i', $name[1], $names)) {
- $comment['name'] = $names[2];
- $comment['email'] = $names[1];
+ $comment['name'] = utf8_decode($names[2]);
+ $comment['email'] = utf8_decode($names[1]);
} else {
- $comment['name'] = $names[1];
+ $comment['name'] = utf8_decode($names[1]);
}
}
if (preg_match('@<link[^>]*>(.*)</link[^>]*>@i', $HTTP_RAW_POST_DATA, $link)) {
- $comment['url'] = $link[1];
+ $comment['url'] = utf8_decode($link[1]);
}
if (preg_match('@<description[^>]*>(.*)</description[^>]*>@ims', $HTTP_RAW_POST_DATA, $description)) {
if (preg_match('@^<!\[CDATA\[(.*)\]\]>@ims', $description[1], $cdata)) {
- $comment['comment'] = $cdata[1];
+ $comment['comment'] = utf8_decode($cdata[1]);
} else {
- $comment['comment'] = $description[1];
+ $comment['comment'] = utf8_decode($description[1]);
}
if (!empty($comment['comment'])) {
|