From a4dccb579a2e7a7d45ca7f84c99a5dd66f0495a6 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 13 Feb 2026 09:07:50 +0000 Subject: [PATCH] adding read more --- index.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 7f4592a..5a33a46 100644 --- a/index.php +++ b/index.php @@ -128,7 +128,15 @@ $cases = $stmt->fetchAll(); $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? $t['subtitle']; $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; -// Helper for safe truncation +// Helpers for safe string operations +function safe_strlen($text) { + if (empty($text)) return 0; + if (function_exists('mb_strlen')) { + return mb_strlen($text); + } + return strlen($text); +} + function safe_truncate($text, $limit = 120) { if (empty($text)) return ''; if (function_exists('mb_strimwidth')) { @@ -664,7 +672,7 @@ function safe_truncate($text, $limit = 120) { 120; + $is_long = safe_strlen($full_desc) > 120; $truncated_desc = safe_truncate($full_desc, 120); ?>