diff --git a/data/System/RenderPlugin.txt b/data/System/RenderPlugin.txt index 0509629..c66de51 100644 --- a/data/System/RenderPlugin.txt +++ b/data/System/RenderPlugin.txt @@ -141,11 +141,12 @@ One line description, required for extensions repository catalog. --> | Plugin Author: | Michael Daum | -| Copyright ©: | 2006-2013, Michael Daum http://michaeldaumconsulting.com | +| Copyright ©: | 2006-2014, Michael Daum http://michaeldaumconsulting.com | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Release: | %$RELEASE% | | Version: | %$VERSION% | | Change History: |   | +| 18 Mar 2014: | removed duplicate http header from =render= rest handler | | 01 Nov 2013: | added support for =contenttype= url parameter | | 10 Jan 2012: | some docu fixes | | 12 May 2009: | added =template= handler | diff --git a/lib/Foswiki/Plugins/RenderPlugin.pm b/lib/Foswiki/Plugins/RenderPlugin.pm index 2353102..c3aeaa8 100644 --- a/lib/Foswiki/Plugins/RenderPlugin.pm +++ b/lib/Foswiki/Plugins/RenderPlugin.pm @@ -1,6 +1,6 @@ # Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/ # -# Copyright (C) 2008-2013 Michael Daum http://michaeldaumconsulting.com +# Copyright (C) 2008-2014 Michael Daum http://michaeldaumconsulting.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -22,8 +22,8 @@ use Foswiki::Func (); use Foswiki::Sandbox() ; use Encode (); -our $VERSION = '3.20'; -our $RELEASE = '3.20'; +our $VERSION = '3.21'; +our $RELEASE = '3.21'; our $SHORTDESCRIPTION = 'Render WikiApplications asynchronously'; our $NO_PREFS_IN_TOPIC = 1; @@ -52,11 +52,17 @@ sub restRender { my ($session, $subject, $verb) = @_; my $query = Foswiki::Func::getCgiQuery(); + my $theText = $query->param('text') || ''; + + return ' ' unless $theText; # must return at least on char as we get a + # premature end of script otherwise + my $theTopic = $query->param('topic') || $session->{topicName}; my $theWeb = $query->param('web') || $session->{webName}; my ($web, $topic) = Foswiki::Func::normalizeWebTopicName($theWeb, $theTopic); - my $result = Foswiki::Func::renderText(restExpand($session, $subject, $verb), $web); + my $result = Foswiki::Func::expandCommonVariables($theText, $topic, $web) || ' '; + $result = Foswiki::Func::renderText($result, $web); my $contentType = $query->param("contenttype"); $session->writeCompletePage($result, undef, $contentType);