Release 2.50 (#5835)

* replace p-0 class with fullsize embed option
* bump parsedown package
* remove support for file:// urls
* fix missing macro in export print template
* fix weekly hours with breaks
This commit is contained in:
Kevin Papst
2026-02-25 21:07:40 +01:00
committed by GitHub
parent 8094fcf5b5
commit 4154de6bd1
22 changed files with 116 additions and 166 deletions

View File

@@ -17,11 +17,11 @@ final class Constants
/**
* The current release version
*/
public const VERSION = '2.49.0';
public const VERSION = '2.50.0';
/**
* The current release: major * 10000 + minor * 100 + patch
*/
public const VERSION_ID = 24900;
public const VERSION_ID = 25000;
/**
* The software name
*/

View File

@@ -95,6 +95,7 @@ final class QuickEntryTimesheetType extends AbstractType
$duration = $data->getDuration(false);
try {
if (null !== $duration) {
$duration += $data->getBreak();
$end = clone $data->getBegin();
$end->modify('+ ' . abs($duration) . ' seconds');
$data->setEnd($end);

View File

@@ -21,15 +21,17 @@ class Parsedown extends \Parsedown
{
$block = parent::blockHeader($Line);
$text = $block['element']['text'];
if (isset($block['element']['handler']['argument'])) {
$text = $block['element']['handler']['argument'];
if (\is_string($text) && $text !== '') {
$id = $this->getIDfromText($text);
if (\is_string($text) && $text !== '') {
$id = $this->getIDfromText($text);
// add id-attribute
$block['element']['attributes'] = [
'id' => $id
];
// add id-attribute
$block['element']['attributes'] = [
'id' => $id
];
}
}
return $block;

View File

@@ -44,55 +44,17 @@ final class ParsedownExtension extends Parsedown
];
/**
* Overwritten to add support for file:///
*/
protected $safeLinksWhitelist = [
'file:///',
'http://',
'https://',
'ftp://',
'ftps://',
'mailto:',
'data:image/png;base64,',
'data:image/gif;base64,',
'data:image/jpeg;base64,',
'irc:',
'ircs:',
'git:',
'ssh:',
'news:',
'steam:',
];
/**
* Overwritten:
* - added support for file:///
* - open links in new windows
* Overwritten to open links in new windows
*/
protected function inlineUrl($Excerpt): ?array
{
if ($this->urlsLinked !== true or !isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') {
return null;
$block = parent::inlineUrl($Excerpt);
if (isset($block['element']['attributes']) && \is_array($block['element']['attributes'])) {
$block['element']['attributes']['target'] = '_blank';
}
if (preg_match('/\b(https?:[\/]{2}|file:[\/]{3})[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE)) {
$url = $matches[0][0];
return [
'extent' => \strlen($matches[0][0]),
'position' => $matches[0][1],
'element' => [
'name' => 'a',
'text' => $url,
'attributes' => [
'href' => $url,
'target' => '_blank'
],
],
];
}
return null;
return $block;
}
protected function blockTable($Line, ?array $Block = null) // @phpstan-ignore missingType.return,missingType.iterableValue,missingType.parameter