diff --git a/Michelf/Markdown.php b/Michelf/Markdown.php index 746a2d0..f75e476 100644 --- a/Michelf/Markdown.php +++ b/Michelf/Markdown.php @@ -5,7 +5,7 @@ * @package php-markdown * @author Michel Fortin * @copyright 2004-2022 Michel Fortin - * @copyright (Original Markdown) 2004-2006 John Gruber + * @copyright Original Markdown 2004-2006 John Gruber */ namespace Michelf; @@ -1079,7 +1079,7 @@ protected function _doLists_callback($matches) { } } - if ($ol_start > 1 && $list_type == 'ol'){ + if ($ol_start > 1){ $result = $this->hashBlock("<$list_type start=\"$ol_start\">\n" . $result . ""); } else { $result = $this->hashBlock("<$list_type>\n" . $result . ""); @@ -1782,7 +1782,7 @@ protected function handleSpanToken($token, &$str) { return $this->hashPart("&#". ord($token[1]). ";"); case "`": // Search for end marker in remaining text. - if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', + if (preg_match('/^(.*?[^`])'.preg_quote($token, '/').'(?!`)(.*)$/sm', $str, $matches)) { $str = $matches[2]; diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index 78e265d..340fdf1 100644 --- a/Michelf/MarkdownExtra.php +++ b/Michelf/MarkdownExtra.php @@ -5,7 +5,7 @@ * @package php-markdown * @author Michel Fortin * @copyright 2004-2022 Michel Fortin - * @copyright (Original Markdown) 2004-2006 John Gruber + * @copyright Original Markdown 2004-2006 John Gruber */ namespace Michelf; @@ -218,7 +218,7 @@ protected function teardown() { * which will be used to populate the id attribute in case it was not * overridden. * @param string $tag_name - * @param string $attr + * @param string|null $attr * @param mixed $defaultIdValue * @param array $classes * @return string @@ -1796,7 +1796,7 @@ protected function _appendFootnotes_callback($matches) { protected function parseFootnotePlaceholders($label, $footnote_number, $reference_number) { return str_replace( array('^^', '%%'), - array($footnote_number, $reference_number), + array((string) $footnote_number, (string) $reference_number), $label ); } diff --git a/Michelf/MarkdownInterface.php b/Michelf/MarkdownInterface.php index 84e6545..ede9155 100644 --- a/Michelf/MarkdownInterface.php +++ b/Michelf/MarkdownInterface.php @@ -5,7 +5,7 @@ * @package php-markdown * @author Michel Fortin * @copyright 2004-2022 Michel Fortin - * @copyright (Original Markdown) 2004-2006 John Gruber + * @copyright Original Markdown 2004-2006 John Gruber */ namespace Michelf;