看板初始化提交

This commit is contained in:
zephyr
2026-06-01 21:23:12 -07:00
commit 54a842f4ab
2104 changed files with 241695 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace Kanboard\ExternalLink;
use Kanboard\Core\ExternalLink\ExternalLinkInterface;
/**
* Web Link
*
* @package externalLink
* @author Frederic Guillot
*/
class WebLink extends BaseLink implements ExternalLinkInterface
{
/**
* Get link title
*
* @access public
* @return string
*/
public function getTitle()
{
if (! EXTERNAL_LINK_ALLOW_PRIVATE_NETWORKS && $this->httpClient->isPrivateURL($this->url)) {
$this->logger->info('Blocked attempt to fetch URL from private network: '.$this->url);
return $this->url;
}
// Do not follow redirects to prevent SSRF bypasses through redirect chains.
$html = $this->httpClient->get($this->url, [], false, false);
if (preg_match('/<title>(.*)<\/title>/siU', $html, $matches)) {
return trim($matches[1]);
}
$components = parse_url($this->url);
if (! empty($components['host']) && ! empty($components['path'])) {
return $components['host'].$components['path'];
}
return $this->url;
}
}