⬆️ 🔨 Upgrade PHP Markdown library.

The current version throws deprecated warning with PHP7.1 and PHPUnit.
Upgrade the Markdown library to the current PHP Markdown Lib 1.7.0.
Used composer to manage this library.
This commit is contained in:
Klaus Weidenbach
2017-02-25 19:12:41 +01:00
parent 2848d1caaf
commit 503c368f9e
27 changed files with 7146 additions and 2434 deletions

View File

@@ -3,8 +3,9 @@
* @file include/text.php
*/
require_once("include/bbcode.php");
use \Michelf\MarkdownExtra;
require_once("include/bbcode.php");
// random string, there are 86 characters max in text mode, 128 for hex
// output is urlsafe
@@ -1650,8 +1651,7 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
break;
case 'text/markdown':
require_once('library/markdown.php');
$s = Markdown($text);
$s = MarkdownExtra::defaultTransform($text);
break;
case 'application/x-pdl';
@@ -2062,7 +2062,7 @@ function ids_to_array($arr,$idx = 'id') {
$t = array();
if($arr) {
foreach($arr as $x) {
if(array_key_exists($idx,$x) && strlen($x[$idx]) && (! in_array($x[$idx],$t))) {
if(array_key_exists($idx,$x) && strlen($x[$idx]) && (! in_array($x[$idx],$t))) {
$t[] = $x[$idx];
}
}
@@ -2078,7 +2078,7 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) {
if($arr) {
foreach($arr as $x) {
if(! in_array($x[$idx],$t)) {
if($quote)
if($quote)
$t[] = "'" . dbesc($x[$idx]) . "'";
else
$t[] = $x[$idx];