Skip to content

Commit a85bf74

Browse files
committed
Release phpwcms v1.9.41, the legacy release
Merge branch 'v1.9-dev' into phpwcms-legacy
2 parents 700fe25 + 2efbf2f commit a85bf74

496 files changed

Lines changed: 31251 additions & 7807 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ root or sub folder. Link your browser to the related URL and follow the install
2626
Server system requirements
2727
--------------------------
2828

29-
**phpwcms** version 1.9.39 requires a web server with PHP 7.4 or newer.
29+
**phpwcms** version 1.9.41 requires a web server with PHP 7.4 or newer.
3030
and a MySQL/MariaDB database (minimum version 5.1, recommend 5.5+).
31-
If you already use PHP v8.x you can use the latest version of
32-
[**phpwcms v1.10.3**](https://github.com/slackero/phpwcms/releases/tag/v1.10.3).
31+
If you already use PHP v8.x you should use the latest version of
32+
[**phpwcms v1.10.5**](https://github.com/slackero/phpwcms/releases/tag/v1.10.5).
3333

3434

3535
Known problems

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"algo26-matthias/idna-convert": "^v3.1.1",
1212
"enshrined/svg-sanitize": "^0.19.0",
1313
"netcarver/textile": "v4.1.1",
14-
"erusev/parsedown": "^v2.0.0-beta-1",
15-
"erusev/parsedown-extra": "^v2.0.0-beta-1",
14+
"league/commonmark": "^2.5.1",
15+
"ezyang/htmlpurifier": "^v4.17.0",
1616
"openpsa/universalfeedcreator": "^v1.9.0",
1717
"phpmailer/phpmailer": "^v6.9.1",
1818
"phpoffice/phpspreadsheet": "^1.29.0",

include/config/dist.conf.inc.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@
151151
$phpwcms['enable_GDPR'] = true; // Try to handle GDPR inside of phpwcms by default (anonymize IP...)
152152
$phpwcms['login_autocomplete'] = true; // If true the browser/user can decide to store login/password and/or autofill in credentials
153153
$phpwcms['lazy_loading'] = 'lazy'; // Set how images or iframes should be loaded: lazy (recommend), eager (right away) or auto (let browser decide).
154-
$phpwcms['markdown_extra'] = false; // Enable/disable Markdown Extra https://michelf.ca/projects/php-markdown/extra/
155154
$phpwcms['disable_generator'] = false; // Disable <meta name="generator"> and header `X-phpwcms-Release`
156155
$phpwcms['disable_processed_in'] = false; // Hide header `X-phpwcms-Page-Processed-In`
157156
$phpwcms['session.cookie_httponly.off'] = false; // Set this to `true` if the session Cookie should also be accessible by JavaScript

include/inc_front/content/cnt0.article.inc.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@
4646
switch($crow["acontent_form"]) {
4747

4848
case 'markdown':
49-
init_markdown();
50-
$crow['acontent_text'] = $phpwcms['parsedown_class']->text($crow['acontent_text']);
49+
$crow['acontent_text'] = parse_markdown($crow['acontent_text']);
5150
break;
5251

5352
case 'textile':
54-
init_textile();
55-
$crow['acontent_text'] = $phpwcms['textile_class']->parse($crow['acontent_text']);
53+
$crow['acontent_text'] = parse_textile($crow['acontent_text']);
5654
break;
5755

5856
case 'plain':

include/inc_front/content/cnt14.article.inc.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@
9595
} elseif(isset($crow['fieldgroup'][$custom_field_key]['render']) && in_array($crow['fieldgroup'][$custom_field_key]['render'], $crow['field_render'])) {
9696

9797
if($crow['fieldgroup'][$custom_field_key]['render'] === 'markdown') {
98-
init_markdown();
99-
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], $custom_field_replacer, $phpwcms['parsedown_class']->text($custom_field_value));
98+
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], $custom_field_replacer, parse_markdown($custom_field_value));
10099
} elseif($crow['fieldgroup'][$custom_field_key]['render'] === 'plain') {
101100
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], $custom_field_replacer, plaintext_htmlencode($custom_field_value));
102101
} else {

include/inc_front/content/cnt31.article.inc.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@
6060

6161
if(is_array($image['tmpl_settings']) && count($image['tmpl_settings'])) {
6262
$image = array_merge($image, $image['tmpl_settings']);
63-
64-
if($image['text_render'] === 'markdown') {
65-
init_markdown();
66-
} elseif($image['text_render'] === 'textile') {
67-
init_textile();
68-
}
6963
}
7064

7165
$image['tmpl_header'] = get_tmpl_section('IMAGES_HEADER', $image['template']);
@@ -363,11 +357,11 @@
363357
switch($image['text_render']) {
364358

365359
case 'markdown':
366-
$value['freetext'] = $phpwcms['parsedown_class']->text($value['freetext']);
360+
$value['freetext'] = parse_markdown($value['freetext']);
367361
break;
368362

369363
case 'textile':
370-
$value['freetext'] = $phpwcms['textile_class']->parse($value['freetext']);
364+
$value['freetext'] = parse_textile($value['freetext']);
371365
break;
372366

373367
case 'html':
@@ -479,8 +473,7 @@
479473
} elseif(isset($image['fieldgroup'][$custom_field_key]['render']) && in_array($image['fieldgroup'][$custom_field_key]['render'], $image['field_render'])) {
480474

481475
if($image['fieldgroup'][$custom_field_key]['render'] === 'markdown') {
482-
init_markdown();
483-
$img_a = render_cnt_template($img_a, $custom_field_replacer, $phpwcms['parsedown_class']->text($custom_field_value));
476+
$img_a = render_cnt_template($img_a, $custom_field_replacer, parse_markdown($custom_field_value));
484477
} elseif($image['fieldgroup'][$custom_field_key]['render'] === 'plain') {
485478
$img_a = render_cnt_template($img_a, $custom_field_replacer, plaintext_htmlencode($custom_field_value));
486479
} else {

include/inc_front/content/cnt32.article.inc.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@
150150
} elseif(isset($tabs['fieldgroup'][$custom_field_key]['render']) && in_array($tabs['fieldgroup'][$custom_field_key]['render'], $tabs['field_render'])) {
151151

152152
if($tabs['fieldgroup'][$custom_field_key]['render'] === 'markdown') {
153-
init_markdown();
154-
$tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], $custom_field_replacer, $phpwcms['parsedown_class']->text($custom_field_value));
153+
$tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], $custom_field_replacer, parse_markdown($custom_field_value));
155154
} elseif($tabs['fieldgroup'][$custom_field_key]['render'] === 'plain') {
156155
$tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], $custom_field_replacer, plaintext_htmlencode($custom_field_value));
157156
} else {

include/inc_front/content/cnt33.article.inc.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,11 @@
445445
$value['cnt_teasertext'] = br_htmlencode($value['cnt_teasertext']);
446446
$value['cnt_description'] = br_htmlencode($value['cnt_description']);
447447
} elseif($value['cnt_object']['cnt_textformat'] === 'markdown') {
448-
init_markdown();
449-
$value['cnt_teasertext'] = $phpwcms['parsedown_class']->text($value['cnt_teasertext']);
450-
$value['cnt_description'] = $phpwcms['parsedown_class']->text($value['cnt_description']);
448+
$value['cnt_teasertext'] = parse_markdown($value['cnt_teasertext']);
449+
$value['cnt_description'] = parse_markdown($value['cnt_description']);
451450
} elseif($value['cnt_object']['cnt_textformat'] === 'textile') {
452-
init_textile();
453-
$value['cnt_teasertext'] = $phpwcms['textile_class']->parse($value['cnt_teasertext']);
454-
$value['cnt_description'] = $phpwcms['textile_class']->parse($value['cnt_description']);
451+
$value['cnt_teasertext'] = parse_textile($value['cnt_teasertext']);
452+
$value['cnt_description'] = parse_textile($value['cnt_description']);
455453
} else {
456454
$value['cnt_teasertext'] = html($value['cnt_teasertext']);
457455
$value['cnt_description'] = html($value['cnt_description']);

include/inc_front/front.func.inc.php

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4556,16 +4556,16 @@ function get_attr_data_gallery($group='', $prefix=' ', $suffix='') {
45564556
}
45574557

45584558
/**
4559-
* Init Parsedown or ParsedownExtra Class
4559+
* Init CommonMark Class
4560+
* @link https://commonmark.thephpleague.com/
45604561
*/
45614562
function init_markdown() {
45624563

4563-
if(!isset($GLOBALS['phpwcms']['parsedown_class'])) {
4564-
if (empty($GLOBALS['phpwcms']['markdown_extra'])) {
4565-
$GLOBALS['phpwcms']['parsedown_class'] = new \Erusev\Parsedown\Parsedown();
4566-
} else {
4567-
$GLOBALS['phpwcms']['parsedown_class'] = new \Erusev\ParsedownExtra\ParsedownExtra();
4568-
}
4564+
if(!isset($GLOBALS['phpwcms']['commonmark_class'])) {
4565+
$environment = new \League\CommonMark\Environment\Environment();
4566+
$environment->addExtension(new \League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension());
4567+
$environment->addExtension(new \League\CommonMark\Extension\GithubFlavoredMarkdownExtension());
4568+
$GLOBALS['phpwcms']['commonmark_class'] = new \League\CommonMark\MarkdownConverter($environment);
45694569
}
45704570

45714571
}
@@ -4580,3 +4580,30 @@ function init_textile() {
45804580
}
45814581

45824582
}
4583+
4584+
/**
4585+
* Parse content with CommonMark
4586+
* @link https://commonmark.thephpleague.com/
4587+
*
4588+
* @param string $text
4589+
*/
4590+
function parse_markdown(string $text) {
4591+
if ($text === '') {
4592+
return '';
4593+
}
4594+
init_markdown();
4595+
return $GLOBALS['phpwcms']['commonmark_class']->convert($text);
4596+
}
4597+
4598+
/**
4599+
* Parse content with Textile
4600+
*
4601+
* @param string $text
4602+
*/
4603+
function parse_textile(string $text) {
4604+
if ($text === '') {
4605+
return '';
4606+
}
4607+
init_textile();
4608+
return $GLOBALS['phpwcms']['textile_class']->textileThis($text);
4609+
}

include/inc_lib/revision/revision.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
*
1010
**/
1111

12-
const PHPWCMS_VERSION = '1.9.40';
13-
const PHPWCMS_RELEASE_DATE = '2024/08/06';
12+
const PHPWCMS_VERSION = '1.9.41';
13+
const PHPWCMS_RELEASE_DATE = '2024/08/10';
1414
const PHPWCMS_REVISION = '553';

0 commit comments

Comments
 (0)