tag for the display name * - Looks for a poster image with the same base name: * example: wart.html -> wart.png|jpg|jpeg|webp|svg|gif|avif */ declare(strict_types=1); function h(string $s): string { return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } function getTitleFromHtml(string $path): string { // Read a chunk (enough for head/title in most cases) $maxBytes = 262144; // 256KB $fh = @fopen($path, 'rb'); if (!$fh) return ''; $chunk = @fread($fh, $maxBytes); @fclose($fh); if ($chunk === false || $chunk === '') return ''; // Try to find ... No poster found
tag for the display name * - Looks for a poster image with the same base name: * example: wart.html -> wart.png|jpg|jpeg|webp|svg|gif|avif */ declare(strict_types=1); function h(string $s): string { return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } function getTitleFromHtml(string $path): string { // Read a chunk (enough for head/title in most cases) $maxBytes = 262144; // 256KB $fh = @fopen($path, 'rb'); if (!$fh) return ''; $chunk = @fread($fh, $maxBytes); @fclose($fh); if ($chunk === false || $chunk === '') return ''; // Try to find ...