[PHP-WEBMASTER] [web-php] master: Fix missing “Copy” button on the Windows download page (#1981)

Author: Weilin Du (LamentXU123)
Committer: GitHub (web-flow)
Pusher: sy-records
Date: 2026-08-04T12:42:44+08:00

Commit: Fix missing “Copy” button on the Windows download page (#1981) · php/web-php@8e5a5eb · GitHub
Raw diff: https://github.com/php/web-php/commit/8e5a5eb838e9830bc9e4159224f7e09fed4cd141.diff

Fix missing “Copy” button on the Windows download page (#1981)

Changed paths:
  M include/download-instructions/windows-downloads.php

Diff:

diff --git a/include/download-instructions/windows-downloads.php b/include/download-instructions/windows-downloads.php
index a3f78d730d..aca829536e 100644
--- a/include/download-instructions/windows-downloads.php
+++ b/include/download-instructions/windows-downloads.php
@@ -125,7 +125,9 @@ function ws_has_sbom(string $version, string $fullVersion): bool {
       if (!empty($entry[$type]['path'])) {
         $p = $entry[$type]['path'];
         echo "\t", '<p><strong><a href="' . $baseDownloads . $p . '">' . $package_names[$type] . '</a></strong> <span class="size">' . $entry[$type]['size'] . '</span><br>', PHP_EOL;
- echo "\t", '<span class="sha256">' . ($entry[$type]['sha256'] ?? '') . '</span>', PHP_EOL;
+ if (!empty($entry[$type]['sha256'])) {
+ echo "\t", sha256_html($entry[$type]['sha256']), PHP_EOL;
+ }
         if ($type === 'zip' && $hasSbom) {
           echo "\t", '<span class="sbom"><a href="' . $baseDownloads . $p . '.spdx.json">SPDX</a>|<a href="' . $baseDownloads . $p . '.cdx.json">CDX</a></span>', PHP_EOL;
         }