Deploy: 2026-05-23 18:30:59

This commit is contained in:
Hamza-Ayed
2026-05-23 18:30:59 +03:00
parent 354e60a99e
commit 254b8b9094
2 changed files with 36 additions and 5 deletions

View File

@@ -116,10 +116,10 @@ class WhatsAppClient {
foreach ($fonts as $filename => $url) {
$path = $fontDir . '/' . $filename;
if (!file_exists($path) || @filesize($path) < 1000) {
if (!file_exists($path) || @filesize($path) < 20000) {
// Try file_get_contents first
$content = @file_get_contents($url);
if ($content !== false && strlen($content) > 1000) {
if ($content !== false && strlen($content) > 20000) {
@file_put_contents($path, $content);
} elseif (function_exists('curl_init')) {
$ch = curl_init($url);
@@ -129,7 +129,7 @@ class WhatsAppClient {
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$content = curl_exec($ch);
curl_close($ch);
if ($content && strlen($content) > 1000) {
if ($content && strlen($content) > 20000) {
@file_put_contents($path, $content);
}
}
@@ -167,10 +167,10 @@ class WhatsAppClient {
$availableFonts = [];
if (function_exists('imagettftext')) {
$fontDir = __DIR__ . '/../fonts';
if (file_exists($fontDir . '/Roboto-Bold.ttf') && @filesize($fontDir . '/Roboto-Bold.ttf') > 1000) {
if (file_exists($fontDir . '/Roboto-Bold.ttf') && @filesize($fontDir . '/Roboto-Bold.ttf') > 20000) {
$availableFonts[] = $fontDir . '/Roboto-Bold.ttf';
}
if (file_exists($fontDir . '/CourierPrime-Bold.ttf') && @filesize($fontDir . '/CourierPrime-Bold.ttf') > 1000) {
if (file_exists($fontDir . '/CourierPrime-Bold.ttf') && @filesize($fontDir . '/CourierPrime-Bold.ttf') > 20000) {
$availableFonts[] = $fontDir . '/CourierPrime-Bold.ttf';
}
if (!empty($availableFonts)) {