Update src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php

Fix wrong white space from copy/paste from editor.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tobias Bäthge
2026-03-23 21:57:39 +01:00
committed by GitHub
parent c7f3ffba19
commit c20e9a8021
+11 -12
View File
@@ -46,18 +46,17 @@ class Hyperlinks
$cell = $worksheet->getCell($cellReference);
$hyperlinkUrl = '';
if (isset($linkRel['id'])) {
$hyperlinkUrl = $this->hyperlinks[(string) $linkRel['id']] ?? '';
}
if (isset($attributes['location'])) {
if ($hyperlinkUrl === '') {
$hyperlinkUrl = 'sheet://' . (string) $attributes['location'];
} else {
$hyperlinkUrl .= '#' . (string) $attributes['location'];
}
}
$cell->getHyperlink()->setUrl($hyperlinkUrl);
if (isset($linkRel['id'])) {
$hyperlinkUrl = $this->hyperlinks[(string) $linkRel['id']] ?? '';
}
if (isset($attributes['location'])) {
if ($hyperlinkUrl === '') {
$hyperlinkUrl = 'sheet://' . (string) $attributes['location'];
} else {
$hyperlinkUrl .= '#' . (string) $attributes['location'];
}
}
$cell->getHyperlink()->setUrl($hyperlinkUrl);
// Tooltip
if (isset($attributes['tooltip'])) {
$cell->getHyperlink()->setTooltip((string) $attributes['tooltip']);