From 70efee1bc5b87377c093163a58e0b9bb03a59778 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 10 Feb 2009 22:54:22 +0000 Subject: [PATCH] Leave wiki links untouched if target project doesn't exist or have no wiki. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2436 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 2 +- test/unit/helpers/application_helper_test.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 552a4cde1..0fb05178c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -418,7 +418,7 @@ module ApplicationHelper :class => ('wiki-page' + (wiki_page ? '' : ' new'))) else # project or wiki doesn't exist - title || page + all end else all diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index cafa92ef4..c72ab1706 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -195,6 +195,9 @@ class ApplicationHelperTest < HelperTestCase '-[[Another page|Page]] link-' => 'Page link', # escaping '![[Another page|Page]]' => '[[Another page|Page]]', + # project does not exist + '[[unknowproject:Start]]' => '[[unknowproject:Start]]', + '[[unknowproject:Start|Page title]]' => '[[unknowproject:Start|Page title]]', } @project = Project.find(1) to_test.each { |text, result| assert_equal "

#{result}

", textilizable(text) }