From: Koosha KM Date: Thu, 11 Sep 2014 13:55:01 +0000 (+0000) Subject: Bug 1064933: Bugzilla.pm does not compile without Text::Markdown X-Git-Tag: bugzilla-4.5.6~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c11b241b985511c01803df200d31afb793f11903;p=thirdparty%2Fbugzilla.git Bug 1064933: Bugzilla.pm does not compile without Text::Markdown r=glob,a=sgreen --- diff --git a/Bugzilla.pm b/Bugzilla.pm index 7d935db480..af670e90f4 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -398,6 +398,8 @@ sub logout_request { } sub markdown { + return if !Bugzilla->feature('markdown'); + require Bugzilla::Markdown; return $_[0]->request_cache->{markdown} ||= Bugzilla::Markdown->new(); } diff --git a/Bugzilla/Markdown.pm b/Bugzilla/Markdown.pm index 6cbe0f6c48..5f1a7d955b 100644 --- a/Bugzilla/Markdown.pm +++ b/Bugzilla/Markdown.pm @@ -62,8 +62,7 @@ sub markdown { my $text = shift; my $user = Bugzilla->user; - if (Bugzilla->feature('markdown') - && $user->settings->{use_markdown}->{is_enabled} + if ($user->settings->{use_markdown}->{is_enabled} && $user->setting('use_markdown') eq 'on') { return $self->SUPER::markdown($text, @_); diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 78a3e41202..aee7933ede 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -813,8 +813,9 @@ sub create { my $text = shift; return unless $text; - if ((ref($comment) eq 'HASH' && $comment->{is_markdown}) - || (ref($comment) eq 'Bugzilla::Comment' && $comment->is_markdown)) + if (Bugzilla->feature('markdown') + && ((ref($comment) eq 'HASH' && $comment->{is_markdown}) + || (ref($comment) eq 'Bugzilla::Comment' && $comment->is_markdown))) { return Bugzilla->markdown->markdown($text); }