Update Kirby and add password guard

This commit is contained in:
isUnknown 2026-02-09 17:05:41 +01:00
parent aaf1aa7890
commit 55d4e45891
987 changed files with 160116 additions and 66454 deletions

View file

@ -17,7 +17,7 @@ class ParsedownExtra extends Parsedown
{
# ~
const version = '0.8.0-beta-1';
public const version = '0.8.0-beta-2';
# ~
@ -297,7 +297,7 @@ class ParsedownExtra extends Parsedown
#
# Setext
protected function blockSetextHeader($Line, array $Block = null)
protected function blockSetextHeader($Line, array|null $Block = null)
{
$Block = parent::blockSetextHeader($Line, $Block);
@ -465,7 +465,7 @@ class ParsedownExtra extends Parsedown
),
);
uasort($this->DefinitionData['Footnote'], 'self::sortFootnotes');
uasort($this->DefinitionData['Footnote'], [$this,'sortFootnotes']);
foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData) {
if (! isset($DefinitionData['number'])) {
@ -568,10 +568,23 @@ class ParsedownExtra extends Parsedown
# http://stackoverflow.com/q/1148928/200145
libxml_use_internal_errors(true);
$DOMDocument = new DOMDocument;
$DOMDocument = new DOMDocument();
# http://stackoverflow.com/q/11309194/200145
$elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8');
// Migrating away from `mb_convert_encoding($elementMarkup,
//'HTML-ENTITIES', 'UTF-8');` has caused multibyte characters like
// emojis not to be converted into entities, which is needed so that
// the `DOM` extension can properly parse the markup.
// The following line works like this: It treats the input string
// as UTF-8 and converts every Unicode character with 8 or more bits
// (= character code starting at 128 or 0x80 up to the Unicode limit
// of 0x10ffff) to an entity; the third and fourth arguments for the
// map are not needed for our use case and are set to the default values
// (no offset and a full mask)
// [http://stackoverflow.com/q/11309194/200145]
$elementMarkup = mb_encode_numericentity($elementMarkup, [0x80, 0x10ffff, 0, 0xffffff], 'UTF-8');
# Ensure that saveHTML() is not remove new line characters. New lines will be split by this character.
$DOMDocument->formatOutput = true;
# http://stackoverflow.com/q/4879946/200145
$DOMDocument->loadHTML($elementMarkup);

View file

@ -17,7 +17,7 @@ class Parsedown
{
# ~
const version = '1.8.0-beta-7';
public const version = '1.8.0-beta-8';
# ~
@ -207,11 +207,9 @@ class Parsedown
$CurrentBlock = $Block;
continue;
} else {
if ($this->isBlockCompletable($CurrentBlock['type'])) {
$methodName = 'block' . $CurrentBlock['type'] . 'Complete';
$CurrentBlock = $this->$methodName($CurrentBlock);
}
} elseif ($this->isBlockCompletable($CurrentBlock['type'])) {
$methodName = 'block' . $CurrentBlock['type'] . 'Complete';
$CurrentBlock = $this->$methodName($CurrentBlock);
}
}
@ -528,7 +526,7 @@ class Parsedown
#
# List
protected function blockList($Line, array $CurrentBlock = null)
protected function blockList($Line, array|null $CurrentBlock = null)
{
list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}+[.\)]');
@ -743,7 +741,7 @@ class Parsedown
#
# Setext
protected function blockSetextHeader($Line, array $Block = null)
protected function blockSetextHeader($Line, array|null $Block = null)
{
if (! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
return;
@ -823,7 +821,7 @@ class Parsedown
#
# Table
protected function blockTable($Line, array $Block = null)
protected function blockTable($Line, array|null $Block = null)
{
if (! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
return;
@ -1597,12 +1595,10 @@ class Parsedown
$markup .= $this->elements($Element['elements']);
} elseif (isset($Element['element'])) {
$markup .= $this->element($Element['element']);
} elseif (!$permitRawHtml) {
$markup .= self::escape($text, true);
} else {
if (!$permitRawHtml) {
$markup .= self::escape($text, true);
} else {
$markup .= $text;
}
$markup .= $text;
}
$markup .= $hasName ? '</' . $Element['name'] . '>' : '';

View file

@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2011 Vladimir Andersen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

File diff suppressed because it is too large Load diff