Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27113/plugins/serendipity_plugin_history
Modified Files:
serendipity_plugin_history.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: serendipity_plugin_history.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_history/serendipity_plugin_history.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- serendipity_plugin_history.php 2 Dec 2004 10:55:08 -0000 1.17
+++ serendipity_plugin_history.php 2 Dec 2004 14:11:30 -0000 1.18
@@ -218,7 +218,7 @@
$date = ($displaydate == '0' ? '' : serendipity_strftime($dateformat, $e[$x]['timestamp']));
$t = ($maxlength == 0 || strlen($e[$x]['title']) <= $maxlength)
? $e[$x]['title']
- : trim(substr($e[$x]['title'], 0, $maxlength - 3)) . ' [...]';
+ : trim(serendipity_mb('substr', $e[$x]['title'], 0, $maxlength - 3)) . ' [...]';
echo $date . '"<a href="' . $url . '" title="' . htmlspecialchars($e[$x]['title']) . '">' . $t . '</a> '
. strip_tags($e[$x]['body']) . '<br />';
|