Update Markdown to v2.0.0 and other misc. changes to support PHP v8

This commit is contained in:
Tom Mortensen
2022-12-02 12:14:14 -08:00
parent 362e9fd657
commit 97a1f5e4f0
7 changed files with 2888 additions and 2335 deletions
+5 -3
View File
@@ -28,8 +28,10 @@ $(function() {
<?endif;?>
<?
$myPage['text'] = $page['text'] = $pages['Vars']['text'] = $language = $text = $notes = $site = '...';
ksort($GLOBALS);
if (isset($GLOBALS['_SERVER']['PHP_AUTH_PW'])) $GLOBALS['_SERVER']['PHP_AUTH_PW'] = "***";
echo ($display['resize'] ? "<pre class='up' style='display:none'>" : "<pre class='up'>").htmlspecialchars(print_r($GLOBALS,true))."</pre>";
$globals = $GLOBALS;
ksort($globals);
if (isset($globals['_SERVER']['PHP_AUTH_PW'])) $globals['_SERVER']['PHP_AUTH_PW'] = "***";
echo ($display['resize'] ? "<pre class='up' style='display:none'>" : "<pre class='up'>").htmlspecialchars(print_r($globals,true))."</pre>";
phpinfo();
?>
<input type="button" value="_(Done)_" onclick="done()">
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,17 @@
<?php
// Use this file if you cannot use class autoloading. It will include all the
// files needed for the MarkdownExtra parser.
//
// Take a look at the PSR-0-compatible class autoloading implementation
// in the Readme.php file if you want a simple autoloader setup.
require_once dirname(__FILE__) . '/MarkdownInterface.php';
require_once dirname(__FILE__) . '/Markdown.php';
require_once dirname(__FILE__) . '/MarkdownExtra.php';
// Limetech - let's make this backward-compatible with how we use it.
use Michelf\MarkdownExtra;
function Markdown($text) {
return MarkdownExtra::defaultTransform($text);
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,38 @@
<?php
/**
* Markdown - A text-to-HTML conversion tool for web writers
*
* @package php-markdown
* @author Michel Fortin <michel.fortin@michelf.com>
* @copyright 2004-2022 Michel Fortin <https://michelf.com/projects/php-markdown/>
* @copyright (Original Markdown) 2004-2006 John Gruber <https://daringfireball.net/projects/markdown/>
*/
namespace Michelf;
/**
* Markdown Parser Interface
*/
interface MarkdownInterface {
/**
* Initialize the parser and return the result of its transform method.
* This will work fine for derived classes too.
*
* @api
*
* @param string $text
* @return string
*/
public static function defaultTransform(string $text): string;
/**
* Main function. Performs some preprocessing on the input text
* and pass it through the document gamut.
*
* @api
*
* @param string $text
* @return string
*/
public function transform(string $text): string;
}
+1 -1
View File
@@ -11,7 +11,7 @@
*/
?>
<?
require_once "$docroot/webGui/include/Markdown.php";
require_once "$docroot/webGui/include/MarkdownExtra.inc.php";
function get_ini_key($key,$default) {
$x = strpos($key, '[');
+2 -1
View File
@@ -11,6 +11,8 @@
*/
?>
<?
require_once "$docroot/webGui/include/MarkdownExtra.inc.php";
// start new session as required
if (session_status()==PHP_SESSION_NONE && !isset($login_locale)) {
session_start();
@@ -21,7 +23,6 @@ $session = '/var/lib/php/sess_'.session_id();
if (file_exists($session)) {
if (filesize($session)===0 || (count($_SESSION??[])==1 && isset($_SESSION['locale']))) unlink($session);
}
require_once "$docroot/webGui/include/Markdown.php";
function _($text, $do=-1) {
// PHP translation function _