Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'Release02x01'
  • Loading branch information
gac410 committed Dec 23, 2016
2 parents 090662a + 72760ff commit 64eafab
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 39 deletions.
4 changes: 2 additions & 2 deletions PatternSkin/templates/attach.pattern.tmpl
Expand Up @@ -42,8 +42,8 @@ class="foswikiHelp"

%TMPL:P{"previous"}%%IF{"$ATTACHFILESIZELIMIT > 0" then="%MAKETEXT{"Upload up to [_1] KB." args="%ATTACHFILESIZELIMIT%"}%"}%

<noautolink><input type="hidden" name="filename" value="%ENCODE{"%FILENAME%"}%" />
<input class="foswikiInputField" type="file" name="filepath" value="%ENCODE{"%FILEPATH%"}%" size="70" /></noautolink>
<noautolink><input type="hidden" name="filename" value="%FILENAME%" />
<input class="foswikiInputField" type="file" name="filepath" value="%FILEPATH%" size="70" /></noautolink>
</div>
%TMPL:P{context="BatchUploadPluginEnabled" then="batchupload"}%%TMPL:END%

Expand Down
12 changes: 6 additions & 6 deletions PatternSkin/templates/attachagain.pattern.tmpl
@@ -1,10 +1,10 @@
%TMPL:INCLUDE{"attachagain"}%
%TMPL:INCLUDE{"attachtables"}%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Update attachment [_1] on [_2]" args="[[%ATTACHURLPATH%/%ENCODE{"%FILENAME%"}%][%ENCODE{"%FILENAME%" type="entity"}%]],[[%TOPIC%]]"}%%TMPL:END%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Update attachment [_1] on [_2]" args="[[%ATTACHURLPATH%/%FILENAME%][%FILENAME%]],[[%TOPIC%]]"}%%TMPL:END%



%TMPL:DEF{"versions"}%---++ %MAKETEXT{"Version history of [_1]" args="<nop>%ENCODE{"%FILENAME%" type="entity"}%"}%
%TMPL:DEF{"versions"}%---++ %MAKETEXT{"Version history of [_1]" args="<nop>%FILENAME%"}%
<div class="foswikiAttachments">
%TABLE{%TMPL:P{"commonattachtableattributes"}% summary="%MAKETEXT{"Version history"}%" caption="%MAKETEXT{"Version history"}%"}%
%ATTACHTABLE%</div>%TMPL:END%
Expand All @@ -15,14 +15,14 @@



%TMPL:DEF{"previous"}%<p>%MAKETEXT{"Select a new local file to update attachment"}% <code>%ENCODE{"%FILENAME%" type="entity"}%</code> <span class="foswikiGrayText">%TMPL:P{"fileuser"}%</span></p>%TMPL:END%
%TMPL:DEF{"previous"}%<p>%MAKETEXT{"Select a new local file to update attachment"}% <code>%FILENAME%</code> <span class="foswikiGrayText">%TMPL:P{"fileuser"}%</span></p>%TMPL:END%



%TMPL:DEF{"movedelete"}%<div class="patternMoveAttachment foswikiUnvisited">
%MAKETEXT{"More actions for [_1]:" args="=%ENCODE{"%FILENAME%" type="entity"}%="}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?template=moveattachment&attachment=%ENCODE{"%FILENAME%"}%" value=" %MAKETEXT{"Move"}% "}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?newweb=%TRASHWEB%;newtopic=TrashAttachment;template=renameattachmentdelete;attachment=%ENCODE{"%FILENAME%"}%" value=" %MAKETEXT{"Delete"}% "}%
%MAKETEXT{"More actions for [_1]:" args="=%FILENAME%="}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?template=moveattachment&attachment=%FILENAME%" value=" %MAKETEXT{"Move"}% "}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?newweb=%TRASHWEB%;newtopic=TrashAttachment;template=renameattachmentdelete;attachment=%FILENAME%" value=" %MAKETEXT{"Delete"}% "}%
</input></div>
%TMPL:END%

Expand Down
3 changes: 2 additions & 1 deletion core/data/System/ReleaseNotes02x01.txt
Expand Up @@ -54,7 +54,7 @@ Foswiki is released under the GNU General Public License.
* Foswiki 2.1.0 was built on 02 Feb 2016. It is a release that contains 37 fixes and 14 enhancements. It closes 7 Feature Requests.
* Foswiki 2.1.1 was built on 30 Apr 2016. It is a release that contains 36 fixes and 21 enhancements.
* Foswiki 2.1.2 was built on 2 May 2016. It is a release that contains 1 fix.
* Foswiki 2.1.3 was built on ... It is a release that contains 42 fixes and 20 enhancements.
* Foswiki 2.1.3 was built on ... It is a release that contains 49 fixes and 21 enhancements.


---++ Pre-installed Extensions
Expand Down Expand Up @@ -399,6 +399,7 @@ Foswiki thanks the Translators for their efforts. If you are interesting in hel
| [[%BUGS%/Item14251][Item14251]] | Remove non-functional caching of dialogs loaded via ajax. |
| [[%BUGS%/Item14253][Item14253]] | WysiwygPlugin inserts extra spaces in front of square bracket links. |
| [[%BUGS%/Item14256][Item14256]] | Data loss of certain formfield names when moving content from 1.x to 2.x. |
| [[%BUGS%/Item14258][Item14258]] | EditRowPlugin will crash with empty column format. |

---+++ Enhancements

Expand Down
2 changes: 2 additions & 0 deletions core/lib/Foswiki/UI/Attach.pm
Expand Up @@ -93,7 +93,9 @@ sub attach {

# must come after templates have been read
$atext .= $session->attach->formatVersions( $topicObject, %$args );
$fileName = Foswiki::entityEncode($fileName);
}

$tmpl =~ s/%ATTACHTABLE%/$atext/g;
$tmpl =~ s/%FILEUSER%/$fileWikiUser/g;
$tmpl =~ s/%FILENAME%/$fileName/g;
Expand Down
6 changes: 3 additions & 3 deletions core/lib/Foswiki/UI/Edit.pm
Expand Up @@ -319,9 +319,9 @@ sub init_edit {
}

# Sanitizing to prevent escape from ENCODE
$templateTopic =~ s/['"]//g if $templateTopic;
$redirectTo =~ s/['"]//g if $redirectTo;
$parentTopic =~ s/['"]//g if $parentTopic;
$templateTopic = Foswiki::entityEncode($templateTopic) if $templateTopic;
$redirectTo = Foswiki::entityEncode($redirectTo) if $redirectTo;
$parentTopic = Foswiki::entityEncode($parentTopic) if $parentTopic;

# The template might contain embedded META data, so serialize it
# and deserialize it to pick up the embedded meta.
Expand Down
23 changes: 11 additions & 12 deletions core/lib/Foswiki/UI/Preview.pm
Expand Up @@ -106,11 +106,10 @@ sub preview {
else {
$tmpl =~ s/%FORCENEWREVISIONCHECKBOX%//g;
}
my $saveCmd = $query->param('cmd') || '';
my $saveCmd = Foswiki::entityEncode( $query->param('cmd') || '' );
$tmpl =~ s/%CMD%/$saveCmd/g;

my $redirectTo = $query->param('redirectto') || '';
$redirectTo =~ s/['"]//g if $redirectTo;
my $redirectTo = Foswiki::entityEncode( $query->param('redirectto') || '' );
$tmpl =~ s/%REDIRECTTO%/$redirectTo/g;

$formName ||= '';
Expand Down Expand Up @@ -142,25 +141,25 @@ sub preview {
# note: preventing linkage in rendered form can only happen in templates
# see formtables.tmpl

my $originalrev = $query->param('originalrev'); # rev edit started on
$originalrev =~ s/['"]//g if $originalrev;
my $originalrev =
Foswiki::entityEncode( $query->param('originalrev') || '' )
; # rev edit started on

#ASSERT($originalrev ne '%ORIGINALREV%') if DEBUG;
$tmpl =~ s/%ORIGINALREV%/$originalrev/g if ( defined($originalrev) );
$tmpl =~ s/%ORIGINALREV%/$originalrev/g;

my $templatetopic = $query->param('templatetopic');
$templatetopic =~ s/['"]//g if $templatetopic;
my $templatetopic =
Foswiki::entityEncode( $query->param('templatetopic') || '' );

#ASSERT($templatetopic ne '%TEMPLATETOPIC%') if DEBUG;
$tmpl =~ s/%TEMPLATETOPIC%/$templatetopic/g if ( defined($templatetopic) );
$tmpl =~ s/%TEMPLATETOPIC%/$templatetopic/g;

#this one's worrying, its special, and not set much at all
#$tmpl =~ s/%SETTINGSTOPIC%/$settingstopic/g;
my $newtopic = $query->param('newtopic');
$newtopic =~ s/['"]//g if $newtopic;
my $newtopic = Foswiki::entityEncode( $query->param('newtopic') || '' );

#ASSERT($newtopic ne '%NEWTOPIC%') if DEBUG;
$tmpl =~ s/%NEWTOPIC%/$newtopic/g if ( defined($newtopic) );
$tmpl =~ s/%NEWTOPIC%/$newtopic/g;

# CAUTION: Once expandMacros executes, any template tokens that are expanded
# inside a %ENCODE will be corrupted. So do token substitution before this point.
Expand Down
3 changes: 3 additions & 0 deletions core/lib/Foswiki/UI/Rename.pm
Expand Up @@ -1089,6 +1089,9 @@ sub _newTopicOrAttachmentScreen {
$attachment = '' if not defined $attachment;
$toattachment = '' if not defined $toattachment;

$attachment = Foswiki::entityEncode($attachment);
$toattachment = Foswiki::entityEncode($toattachment);

$tmpl =~ s/%FILENAME%/$attachment/g;
$tmpl =~ s/%NEW_FILENAME%/$toattachment/g;
$tmpl =~ s/%NEW_WEB%/$to->web()/ge;
Expand Down
4 changes: 2 additions & 2 deletions core/templates/attach.tmpl
Expand Up @@ -14,8 +14,8 @@
<td align="right">
%MAKETEXT{"Attach new file"}%
</td><td>
<noautolink><input type="hidden" name="filename" value="%ENCODE{"%FILENAME%"}%" />
<input type="file" name="filepath" value="%ENCODE{"%FILEPATH%"}%" size="50" /></noautolink>
<noautolink><input type="hidden" name="filename" value="%FILENAME%" />
<input type="file" name="filepath" value="%FILEPATH%" size="50" /></noautolink>
</td>
</tr>%TMPL:END%

Expand Down
8 changes: 4 additions & 4 deletions core/templates/attachagain.tmpl
Expand Up @@ -2,22 +2,22 @@

%TMPL:DEF{"titleaction"}%(attach) %TMPL:END%
%TMPL:DEF{"headerhelp"}% %TMPL:END%
%TMPL:DEF{"webaction"}% Update attachment *%ENCODE{"%FILENAME%" type="entity"}%* on *%TOPIC%* %TMPL:END%
%TMPL:DEF{"webaction"}% Update attachment *%FILENAME%* on *%TOPIC%* %TMPL:END%
%TMPL:DEF{"previousdetails"}%
---++ Update attachment <code>%ENCODE{"%FILENAME%" type="entity"}%</code>
---++ Update attachment <code>%FILENAME%</code>
%ATTACHTABLE% %TMPL:END%
%TMPL:DEF{"previous"}%
<tr>
<td align="right">
Previous <br /> upload:
</td><td>
<code>%ENCODE{"%FILEPATH%" type="entity"}%</code> %TMPL:P{"fileuser"}%
<code>%FILEPATH%</code> %TMPL:P{"fileuser"}%
</td>
</tr>%TMPL:END%
%TMPL:DEF{"extranotes"}% * %MAKETEXT{"*Properties:* The comment and visibility (i.e. is attachment hidden) can be changed without uploading a file by pressing \"Change Properties only\"."}% %POPUPWINDOW{"%SYSTEMWEB%.HiddenAttachment" label="%MAKETEXT{"More on hiding attachments"}%"}%%JQREQUIRE{"popupwindow"}%
* %MAKETEXT{"*Change comment:* If you use _Change Properties_ to change a comment, the comment shown in the topic will change, but the comment shown against the attachment history will be the comment when the file was uploaded."}%
* %MAKETEXT{"*Attach new file:* If you select a different file in the browser, it is this that will be updated or added."}%
%TMPL:END%
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value="%MAKETEXT{"Upload file"}%" />%TMPL:P{"sep"}%<input type="submit" class="foswikiSubmit" name="changeproperties" value="%MAKETEXT{"Change properties only"}%" />%TMPL:P{"sep"}%<a href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?attachment=%ENCODE{"%FILENAME%"}%" rel='nofollow'>%MAKETEXT{"Move or delete attachment"}%</a>%TMPL:P{"sep"}%%TMPL:P{"canceltopicaction"}%%TMPL:END%
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value="%MAKETEXT{"Upload file"}%" />%TMPL:P{"sep"}%<input type="submit" class="foswikiSubmit" name="changeproperties" value="%MAKETEXT{"Change properties only"}%" />%TMPL:P{"sep"}%<a href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?attachment=%FILENAME%" rel='nofollow'>%MAKETEXT{"Move or delete attachment"}%</a>%TMPL:P{"sep"}%%TMPL:P{"canceltopicaction"}%%TMPL:END%
%TMPL:DEF{"fileuser"}%(%FILEUSER%)%TMPL:END%
%TMPL:P{"attach"}%%{ end }%
6 changes: 3 additions & 3 deletions core/templates/edit.tmpl
Expand Up @@ -33,11 +33,11 @@
<input type="hidden" name="newtopic" value="%NEWTOPIC%" />
<input type="hidden" name="nowysiwyg" value="%URLPARAM{"nowysiwyg"}%" />
<input type="hidden" name="originalrev" value="%ORIGINALREV%" />
<input type="hidden" name="redirectto" value="%ENCODE{"%REDIRECTTO%" type="safe"}%" />
<input type="hidden" name="redirectto" value="%REDIRECTTO%" />
<input type="hidden" name="rev" value="%URLPARAM{"rev"}%" />
<input type="hidden" name="skin" value="%URLPARAM{"skin"}%" />
<input type="hidden" name="templatetopic" value="%ENCODE{"%TEMPLATETOPIC%" type="safe"}%" />
<input type="hidden" name="topicparent" value="%ENCODE{"%TOPICPARENT%" type="safe"}%" />%TMPL:END%
<input type="hidden" name="templatetopic" value="%TEMPLATETOPIC%" />
<input type="hidden" name="topicparent" value="%TOPICPARENT%" />%TMPL:END%
%{----------------------------------------------------------------------}%
%TMPL:DEF{"sig"}%<div><div class="foswikiLeft"><label for="sig" class="foswikiGrayText">%MAKETEXT{"Your signature to copy/paste:"}%&nbsp;&nbsp;</label><input class="foswikiInputFieldReadOnly" size="41" name="sig" type="text" readonly="readonly" title='%MAKETEXT{"Select, copy and paste your signature text to the bottom of your entry"}%' id="sig" value="%SIGNATUREFORMAT%" /></div><div class="foswikiClear"></div></div>%TMPL:END%
%{----------------------------------------------------------------------}%
Expand Down
6 changes: 3 additions & 3 deletions core/templates/moveattachment.tmpl
Expand Up @@ -6,7 +6,7 @@
%TMPL:DEF{"webaction"}% *%MAKETEXT{"Move file attachment"}%* %TMPL:END%


%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Move attachment [_1]" args="[[%ATTACHURL%/%ENCODE{"%FILENAME%"}%][%ENCODE{"%FILENAME%" type="entity"}%]]"}% %TMPL:END%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Move attachment [_1]" args="[[%ATTACHURL%/%FILENAME%][%FILENAME%]]"}% %TMPL:END%


%TMPL:DEF{"renameformsteps"}%<div class="foswikiFormSteps">
Expand All @@ -25,13 +25,13 @@

%TMPL:DEF{"attachmenthelp"}%<p>%MAKETEXT{"The attachment may be renamed (by appending a number to the name) if an attachment of that name already exists in the target topic."}%</p>%TMPL:END%

%TMPL:DEF{"newweb"}%<p><select class="foswikiSelect" name="newweb" onchange="if (document.rename.newweb.value == 'Trash') { document.rename.newtopic.value = 'TrashAttachment'; }"> %WEBLIST{"<option $marker value=$qname>$name</option>" webs="%TRASHWEB%,public" selection="%WEB%" separator=" "}% </select><input type="hidden" name="attachment" value="%ENCODE{"%FILENAME%"}%" /></p>%TMPL:END%
%TMPL:DEF{"newweb"}%<p><select class="foswikiSelect" name="newweb" onchange="if (document.rename.newweb.value == 'Trash') { document.rename.newtopic.value = 'TrashAttachment'; }"> %WEBLIST{"<option $marker value=$qname>$name</option>" webs="%TRASHWEB%,public" selection="%WEB%" separator=" "}% </select><input type="hidden" name="attachment" value="%FILENAME%" /></p>%TMPL:END%


%TMPL:DEF{"towebtitle"}%---+++ %MAKETEXT{"Move to web:"}%%TMPL:END%


%TMPL:DEF{"newtopic"}%<p><input name="newtopic" class="foswikiInputField" value="" size="36" /><input type="hidden" name="onlywikiname" value="off" /></p>%TMPL:P{"namehelp"}%%TMPL:END%
%TMPL:DEF{"newtopic"}%<p><input name="newtopic" class="foswikiInputField" value="%TOPIC%" size="36" /><input type="hidden" name="onlywikiname" value="off" /></p>%TMPL:P{"namehelp"}%%TMPL:END%


%TMPL:DEF{"toattachmenttitle"}%---+++ %MAKETEXT{"Attachment name:"}% %TMPL:END%
Expand Down
6 changes: 3 additions & 3 deletions core/templates/renameattachmentdelete.tmpl
Expand Up @@ -25,22 +25,22 @@
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value=' %MAKETEXT{"Delete"}% ' /> %MAKETEXT{"or"}% %TMPL:P{"canceltopicaction"}%%TMPL:END%


%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Delete attachment [_1]" args="[[%ATTACHURL%/%ENCODE{"%FILENAME%"}%][%ENCODE{"%FILENAME%" type="entity"}%]]"}%%TMPL:END%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Delete attachment [_1]" args="[[%ATTACHURL%/%FILENAME%][%FILENAME%]]"}%%TMPL:END%



%TMPL:DEF{"totopictitle"}%---+++ %MAKETEXT{"Optionally enter a different topic name:"}%%TMPL:END%

%TMPL:DEF{"toattachmenttitle"}%---+++ %MAKETEXT{"Optionally enter a different attachment name:"}%%TMPL:END%

%TMPL:DEF{"newattachment"}%<p><input name="newattachment" class="foswikiInputField" value="%ENCODE{"%NEW_FILENAME%"}%" size="36" /><input type="hidden" name="attachment" value="%ENCODE{"%FILENAME%"}%" /></p>%TMPL:P{"attachmenthelp"}%%TMPL:END%
%TMPL:DEF{"newattachment"}%<p><input name="newattachment" class="foswikiInputField" value="%NEW_FILENAME%" size="36" /><input type="hidden" name="attachment" value="%FILENAME%" /></p>%TMPL:P{"attachmenthelp"}%%TMPL:END%

%TMPL:DEF{"newtopic"}%<p><input name="newtopic" class="foswikiInputField" value="%URLPARAM{"newtopic" default="TrashAttachment"}%" size="36" /><input type="hidden" name="onlywikiname" value="on" /></p>%TMPL:P{"namehelp"}%%TMPL:END%


%TMPL:DEF{"namehelp"}%<p>%MAKETEXT{"[_1] is the default topic for deleted attachments." args="[[%TRASHWEB%.TrashAttachment][TrashAttachment]]"}% %MAKETEXT{"If you enter a different name, make sure the topic exists."}%</p>%TMPL:END%

%TMPL:DEF{"attachmenthelp"}%<p>%MAKETEXT{"The attachment may have to be renamed if an attachment called '[_1]' already exists in the target topic." args="%ENCODE{"%FILENAME%" type="entity"}%"}%</p>%TMPL:END%
%TMPL:DEF{"attachmenthelp"}%<p>%MAKETEXT{"The attachment may have to be renamed if an attachment called '[_1]' already exists in the target topic." args="%FILENAME%"}%</p>%TMPL:END%

%TMPL:DEF{"toolbar"}%%TMPL:END%
%TMPL:DEF{"pagehelp"}%%TMPL:END%
Expand Down

0 comments on commit 64eafab

Please sign in to comment.