Update of /cvsroot/php-blog/serendipity/include/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27113/include/admin
Modified Files:
comments.inc.php
Log Message:
use mb_* functions when available. I patched all strtolower/strtoupper/strlen/strpos/strrpos/substr/ucfirst calls which are related to possible UTF-8 input.
For performance reasons, there are native calls left which don't deal with UTF8 characters.
The callback routines for mb_* functions are inside include/lang.inc.php because we need the LANG_CHARSET constant information for the function, and the function needs to be loaded everywhere. compact.inc.php is loaded before languages, so we can'T put it in there.
Index: comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/comments.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- comments.inc.php 1 Dec 2004 11:00:56 -0000 1.7
+++ comments.inc.php 2 Dec 2004 14:11:28 -0000 1.8
@@ -274,7 +274,7 @@
}
$fullBody = nl2br(strip_tags($rs['body']));
- $summary = substr($fullBody, 0, $summaryLength);
+ $summary = serendipity_mb('substr', $fullBody, 0, $summaryLength);
if (strlen($fullBody) > strlen($summary) ) {
$summary .= ' ...';
@@ -284,7 +284,7 @@
?>
<tr>
<td><a name="c<?php echo $rs['id'] ?>"></a>
- <?php echo ($rs['type'] == 'NORMAL' ? COMMENT : TRACKBACK) . ' #'. $rs['id'] .', '. IN_REPLY_TO .' <strong>'. $rs['title'] .'</strong>, '. ON . ' ' . ucfirst(serendipity_strftime('%b %e %Y, %H:%M', $rs['timestamp']))?>
+ <?php echo ($rs['type'] == 'NORMAL' ? COMMENT : TRACKBACK) . ' #'. $rs['id'] .', '. IN_REPLY_TO .' <strong>'. $rs['title'] .'</strong>, '. ON . ' ' . serendipity_mb('ucfirst', serendipity_strftime('%b %e %Y, %H:%M', $rs['timestamp']))?>
</td>
</tr>
<tr>
|