Navigation Menu

Skip to content

Commit

Permalink
Item13899: Make sure text param is processed
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Dec 25, 2015
1 parent 20f6d8e commit cb452f8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/lib/Foswiki/UI/Save.pm
Expand Up @@ -177,17 +177,20 @@ sub buildNewTopic {
$ancestorRev = 0;
}

$text = $query->param('text') if scalar $query->param('text');
if ( defined $text ) {
# $text now contains either text from an existing topic.
# or text obtained from a template topic. Now determine if
# the query params will override it.
if ( defined $query->param('text') ) {

# text is defined in the query, save that text, overriding anything
# from the template or the previous rev of the topic
$text = $query->param('text');
$text =~ s/\r//g;
$text .= "\n" unless $text =~ m/\n$/s;
}
else {
$text = '';
}

# Make sure that text is defined.
$text = '' unless defined $text;

# Change the parent, if appropriate
my $newParent = $query->param('topicparent');
Expand Down

0 comments on commit cb452f8

Please sign in to comment.