diff --git a/lib/url_generator.rb b/lib/url_generator.rb
index 9eb44cd8..44bac253 100644
--- a/lib/url_generator.rb
+++ b/lib/url_generator.rb
@@ -105,6 +105,8 @@ class UrlGenerator < AbstractUrlGenerator
end
def pic_link(mode, name, text, web_address, known_pic)
+ href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file',
+ :id => name
case mode
when :export
if known_pic
@@ -114,13 +116,11 @@ class UrlGenerator < AbstractUrlGenerator
end
when :publish
if known_pic
- %{}
+ %{
}
else
%{#{text}}
end
else
- href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file',
- :id => name
if known_pic
%{
}
else
diff --git a/test/functional/file_controller_test.rb b/test/functional/file_controller_test.rb
index d4c82b8c..07658ca4 100755
--- a/test/functional/file_controller_test.rb
+++ b/test/functional/file_controller_test.rb
@@ -104,6 +104,13 @@ class FileControllerTest < Test::Unit::TestCase
:description => 'Rails, end-to-end'}
assert @web.has_file?('rails-e2e.gif')
assert_equal(picture, WikiFile.find_by_file_name('rails-e2e.gif').content)
+ PageRenderer.setup_url_generator(StubUrlGenerator.new)
+ @wiki.revise_page('wiki1', 'HomePage', 'Try [[rails-e2e.gif:pic]] again.',
+ Time.now, 'AnonymousBrave', renderer)
+ assert_equal "
Try again.
Try again.