Fixed CHANGELOG.md loading in Admin Panel

This commit is contained in:
slawkens 2020-02-25 10:33:57 +01:00
parent 25ab4e187c
commit 0c9219f885
3 changed files with 2003 additions and 8 deletions

View File

@ -4,8 +4,9 @@
### Fixed
* Some weird behaviour with installation of plugins
* CHANGELOG.md loading in Admin Panel
## [0.8.0 - x.02.2020]
## [0.8.0 - 19.02.2020]
### Added:
* new Awesome Bootstrap Admin Panel by Lee (@Leesneaks)

1994
system/libs/Parsedown.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -10,17 +10,17 @@
defined('MYAAC') or die('Direct access not allowed!');
$title = 'MyAAC Changelog';
if (!file_exists(BASE . 'CHANGELOG')) {
echo 'File CHANGELOG doesn\'t exist.';
if (!file_exists(BASE . 'CHANGELOG.md')) {
echo 'File CHANGELOG.md doesn\'t exist.';
return;
}
$changelog = file_get_contents(BASE . 'CHANGELOG');
$changelog = htmlspecialchars($changelog);
require LIBS . 'Parsedown.php';
// replace URLs with <a href...> elements
$changelog = preg_replace('/\s(\w+:\/\/)(\S+)/', ' <a href="\\1\\2" target="_blank">\\1\\2</a>', $changelog);
$changelog = file_get_contents(BASE . 'CHANGELOG.md');
$changelog = nl2br($changelog);
$Parsedown = new Parsedown();
$changelog = $Parsedown->text($changelog); # prints: <p>Hello <em>Parsedown</em>!</p>
echo '<div>' . $changelog . '</div>';