This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via 4acfbe44218e63a4735cfc6479a23ebe035b9e1e (commit)
from 230edfa0b417a482759725bd067f16a8b9e98873 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=4acfbe44218e63a4735cfc6479a23ebe035b9e1e
commit 4acfbe44218e63a4735cfc6479a23ebe035b9e1e
Author: Franck Villaume <[email protected]>
Date: Fri May 3 19:46:12 2019 +0200
Make markdown support compatible with debian 8 & debian 9.
diff --git a/src/common/diary/DiaryNote.class.php
b/src/common/diary/DiaryNote.class.php
index e96a6eb..016ca46 100644
--- a/src/common/diary/DiaryNote.class.php
+++ b/src/common/diary/DiaryNote.class.php
@@ -147,12 +147,13 @@ class DiaryNote extends FFObject {
}
function getDetails() {
+ global $gfcommon;
$result_html = util_gen_cross_ref($this->data_array['details']);
$parsertype = forge_get_config('diary_parser_type');
switch ($parsertype) {
case 'markdown':
- require_once 'markdown.php';
- $result_html = Markdown($result_html);
+ require_once
$gfcommon.'include/Markdown.include.php';
+ $result_html = FF_Markdown($result_html);
break;
default:
$result_html = nl2br($result_html);
diff --git a/src/common/include/Markdown.include.php
b/src/common/include/Markdown.include.php
new file mode 100644
index 0000000..e02621d
--- /dev/null
+++ b/src/common/include/Markdown.include.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Copyright 2019, Franck Villaume - TrivialDev
+ * This file is a part of Fusionforge.
+ *
+ * Fusionforge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Fusionforge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+function FF_Markdown($html) {
+ if (file_exists(stream_resolve_include_path('markdown.php'))) {
+ require_once('markdown.php');
+ return Markdown($html);
+ } elseif
(file_exists(stream_resolve_include_path('Michelf/MarkdownExtra.inc.php'))) {
+ require_once
stream_resolve_include_path('Michelf/MarkdownExtra.inc.php');
+ return \Michelf\MarkdownExtra::defaultTransform($html);
+ } else {
+ return $html;
+ }
+}
diff --git a/src/common/tracker/include/ArtifactHtml.class.php
b/src/common/tracker/include/ArtifactHtml.class.php
index 9e1b216..a71a77b 100644
--- a/src/common/tracker/include/ArtifactHtml.class.php
+++ b/src/common/tracker/include/ArtifactHtml.class.php
@@ -5,7 +5,7 @@
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright (C) 2011-2012 Alain Peyrat - Alcatel-Lucent
* Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2015-2017, Franck Villaume - TrivialDev
+ * Copyright 2015-2017,2019, Franck Villaume - TrivialDev
* Copyright 2016, Stéphane-Eymeric Bredthauer - TrivialDev
* http://fusionforge.org
*
@@ -38,15 +38,15 @@ class ArtifactHtml extends Artifact {
* @return string
*/
function showDetails($editable = false, $editattrs = array()) {
- global $HTML;
+ global $HTML, $gfcommon;
$return = '';
$result = $this->getDetails();
$result_html = util_gen_cross_ref($result,
$this->ArtifactType->Group->getID());
$parsertype = forge_get_config('tracker_parser_type');
switch ($parsertype) {
case 'markdown':
- require_once 'markdown.php';
- $result_html = Markdown($result_html);
+ require_once
$gfcommon.'include/Markdown.include.php';
+ $result_html = FF_Markdown($result_html);
break;
default:
$result_html = nl2br($result_html);
@@ -130,8 +130,8 @@ function hide_edit_button(id) {
$parsertype =
forge_get_config('tracker_parser_type');
switch ($parsertype) {
case 'markdown':
- require_once 'markdown.php';
- $text = Markdown($text);
+ require_once
$gfcommon.'include/Markdown.include.php';
+ $text = FF_Markdown($text);
break;
default:
$text = nl2br($text);
diff --git a/src/www/snippet/browse.php b/src/www/snippet/browse.php
index 78dbc75..c595a6a 100644
--- a/src/www/snippet/browse.php
+++ b/src/www/snippet/browse.php
@@ -103,8 +103,8 @@ if ((!$result || $rows < 1) && (!$result2 || $rows2 < 1)) {
$parsertype = forge_get_config('snippet_parser_type');
switch ($parsertype) {
case 'markdown':
- require_once 'markdown.php';
- $result_html = Markdown(db_result($result2 ,$i
,'description'));
+ require_once
$gfcommon.'include/Markdown.include.php';
+ $result_html = FF_Markdown(db_result($result2
,$i ,'description'));
break;
default:
$result_html =
util_make_links(nl2br(db_result($result2, $i ,'description')));
@@ -130,8 +130,8 @@ if ((!$result || $rows < 1) && (!$result2 || $rows2 < 1)) {
$parsertype = forge_get_config('snippet_parser_type');
switch ($parsertype) {
case 'markdown':
- require_once 'markdown.php';
- $result_html = Markdown(db_result($result ,$i
,'description'));
+ require_once
$gfcommon.'include/Markdown.include.php';
+ $result_html = FF_Markdown(db_result($result
,$i ,'description'));
break;
default:
$result_html =
util_make_links(nl2br(db_result($result, $i ,'description')));
diff --git a/src/www/snippet/snippet_utils.php
b/src/www/snippet/snippet_utils.php
index bf37a03..fd99410 100644
--- a/src/www/snippet/snippet_utils.php
+++ b/src/www/snippet/snippet_utils.php
@@ -215,8 +215,8 @@ function snippet_show_package_details($id) {
$parsertype = forge_get_config('snippet_parser_type');
switch ($parsertype) {
case 'markdown':
- require_once 'markdown.php';
- $result_html = Markdown(db_result($result, 0,
'description'));
+ require_once $gfcommon.'include/Markdown.include.php';
+ $result_html = FF_Markdown(db_result($result, 0,
'description'));
break;
default:
$result_html = util_make_links(nl2br(db_result($result,
0, 'description')));
@@ -257,8 +257,8 @@ function snippet_show_snippet_details($id) {
$parsertype = forge_get_config('snippet_parser_type');
switch ($parsertype) {
case 'markdown':
- require_once 'markdown.php';
- $result_html =
Markdown(db_result($result,0,'description'));
+ require_once $gfcommon.'include/Markdown.include.php';
+ $result_html =
FF_Markdown(db_result($result,0,'description'));
break;
default:
$result_html =
util_make_links(nl2br(db_result($result,0,'description')));
-----------------------------------------------------------------------
Summary of changes:
src/common/diary/DiaryNote.class.php | 5 +++--
.../include/Markdown.include.php} | 18 ++++++++++--------
src/common/tracker/include/ArtifactHtml.class.php | 12 ++++++------
src/www/snippet/browse.php | 8 ++++----
src/www/snippet/snippet_utils.php | 8 ++++----
5 files changed, 27 insertions(+), 24 deletions(-)
copy src/{plugins/hudson/include/HudsonOverviewWidget.class.php =>
common/include/Markdown.include.php} (61%)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits