Improve advertisement description handling for better compatibility
This commit is contained in:
parent
6dd7adeb19
commit
3d5252ad12
@ -123,10 +123,17 @@ if ($adProduct):
|
||||
<div class="ad-tag">🔥 Empfehlung des Tages</div>
|
||||
<h2 class="ad-title"><?= htmlspecialchars($adProduct['model']) ?></h2>
|
||||
<p class="ad-description">
|
||||
<?= htmlspecialchars(mb_strimwidth($adProduct['description'], 0, 150, "...")) ?>
|
||||
<?php
|
||||
$desc = $adProduct['description'];
|
||||
if (function_exists('mb_strimwidth')) {
|
||||
$desc = mb_strimwidth($desc, 0, 150, "...");
|
||||
} else {
|
||||
$desc = strlen($desc) > 150 ? substr($desc, 0, 147) . "..." : $desc;
|
||||
}
|
||||
echo htmlspecialchars($desc);
|
||||
?>
|
||||
</p>
|
||||
<a href="productpage.php?id=<?= $adProduct['productID'] ?>" class="ad-btn">Jetzt entdecken</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user