From f4bd9bc07a7cd9d8502d1e0135c084c7d6f9fc79 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sun, 20 Feb 2022 01:56:52 +0100 Subject: [PATCH] Always use native mb_* functions. --- include/admin/comments.inc.php | 2 +- include/admin/entries.inc.php | 4 ++-- include/admin/overview.inc.php | 2 +- include/functions.inc.php | 2 +- include/functions_entries.inc.php | 2 +- include/functions_trackbacks.inc.php | 2 +- .../serendipity_plugin_history/serendipity_plugin_history.php | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/admin/comments.inc.php b/include/admin/comments.inc.php index 7e4fd519..d99c9754 100644 --- a/include/admin/comments.inc.php +++ b/include/admin/comments.inc.php @@ -310,7 +310,7 @@ if (is_array($sql)) { $i++; $comment = array( 'fullBody' => $rs['body'], - 'summary' => serendipity_mb('substr', $rs['body'], 0, $summaryLength), + 'summary' => mb_substr($rs['body'], 0, $summaryLength), 'status' => $rs['status'], 'type' => $rs['type'], 'id' => $rs['id'], diff --git a/include/admin/entries.inc.php b/include/admin/entries.inc.php index 58042bf1..ff1aa9cc 100644 --- a/include/admin/entries.inc.php +++ b/include/admin/entries.inc.php @@ -285,7 +285,7 @@ switch($serendipity['GET']['adminAction']) { } } elseif ($serendipity['dbType'] == 'sqlite' || $serendipity['dbType'] == 'sqlite3' || $serendipity['dbType'] == 'pdo-sqlite' || $serendipity['dbType'] == 'sqlite3oo') { $term = str_replace('*', '%', $term); - $term = serendipity_mb('strtolower', $term); + $term = mb_strtolower($term); $filter[] = "(lower(title) LIKE '%$term%' OR lower(body) LIKE '%$term%' OR lower(extended) LIKE '%$term%')"; } else { if (preg_match('@["\+\-\*~<>\(\)]+@', $term)) { @@ -468,4 +468,4 @@ if (! isset($data['is_iframepreview'])) { $data['is_iframepreview'] = null; } echo serendipity_smarty_show('admin/entries.inc.tpl', $data); -/* vim: set sts=4 ts=4 expandtab : */ \ No newline at end of file +/* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/overview.inc.php b/include/admin/overview.inc.php index 8daa2fad..e4cc5233 100644 --- a/include/admin/overview.inc.php +++ b/include/admin/overview.inc.php @@ -85,7 +85,7 @@ if (is_array($comments) && count($comments) > 0) { $comment['entrylink'] = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id']; $comment['fullBody'] = $comment['body']; - $comment['summary'] = serendipity_mb('substr', $comment['body'], 0, 100); + $comment['summary'] = mb_substr($comment['body'], 0, 100); if (strlen($comment['fullBody']) > strlen($comment['summary']) ) { $comment['excerpt'] = true; diff --git a/include/functions.inc.php b/include/functions.inc.php index 62436ce9..41301131 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -34,7 +34,7 @@ include_once(S9Y_INCLUDE_PATH . 'include/functions_smarty.inc.php'); */ function serendipity_truncateString($s, $len) { if ( strlen($s) > ($len+3) ) { - $s = serendipity_mb('substr', $s, 0, $len) . '...'; + $s = mb_substr($s, 0, $len) . '...'; } return $s; } diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index a43aa896..c01b2c1c 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -877,7 +877,7 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') { $term = str_replace('*', '%', $term); $cond['group'] = 'GROUP BY e.id'; $cond['distinct'] = ''; - $term = serendipity_mb('strtolower', $term); + $term = mb_strtolower($term); $cond['find_part'] = "(lower(title) LIKE '%$term%' OR lower(body) LIKE '%$term%' OR lower(extended) LIKE '%$term%')"; } else { $cond['group'] = 'GROUP BY e.id'; diff --git a/include/functions_trackbacks.inc.php b/include/functions_trackbacks.inc.php index 899a3360..14b89c85 100644 --- a/include/functions_trackbacks.inc.php +++ b/include/functions_trackbacks.inc.php @@ -605,7 +605,7 @@ function trackback_body_strip($body){ * @return string Output text */ function serendipity_trackback_excerpt($text) { - return serendipity_mb('substr', strip_tags($text), 0, 255); + return mb_substr(strip_tags($text), 0, 255); } /** diff --git a/plugins/serendipity_plugin_history/serendipity_plugin_history.php b/plugins/serendipity_plugin_history/serendipity_plugin_history.php index 01142efc..2c298a7f 100644 --- a/plugins/serendipity_plugin_history/serendipity_plugin_history.php +++ b/plugins/serendipity_plugin_history/serendipity_plugin_history.php @@ -217,7 +217,7 @@ class serendipity_plugin_history extends serendipity_plugin echo '' . $date . ' '; } $t = ($maxlength==0 || strlen($e[$x]['title']) <= $maxlength) ? $e[$x]['title'] - : (trim(serendipity_mb('substr', $e[$x]['title'], 0, $maxlength-3)).' [...]'); + : (trim(mb_substr($e[$x]['title'], 0, $maxlength-3)).' [...]'); echo '"' . serendipity_specialchars($t) . '"'; if ($full) { echo '
' . strip_tags($e[$x]['body']) . '
'; @@ -229,4 +229,4 @@ class serendipity_plugin_history extends serendipity_plugin } /* vim: set sts=4 ts=4 expandtab : */ -?> \ No newline at end of file +?>