Return-Path: X-Original-To: apmail-incubator-jspwiki-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-jspwiki-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C5E6E896 for ; Sun, 20 Jan 2013 20:30:17 +0000 (UTC) Received: (qmail 93895 invoked by uid 500); 20 Jan 2013 20:30:17 -0000 Delivered-To: apmail-incubator-jspwiki-commits-archive@incubator.apache.org Received: (qmail 93873 invoked by uid 500); 20 Jan 2013 20:30:16 -0000 Mailing-List: contact jspwiki-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-commits@incubator.apache.org Received: (qmail 93855 invoked by uid 99); 20 Jan 2013 20:30:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jan 2013 20:30:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jan 2013 20:30:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 68B0E23889DE; Sun, 20 Jan 2013 20:29:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1435944 - in /incubator/jspwiki/trunk: ./ src/org/apache/wiki/ src/webdocs/ src/webdocs/templates/default/editors/ Date: Sun, 20 Jan 2013 20:29:55 -0000 To: jspwiki-commits@incubator.apache.org From: brushed@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130120202955.68B0E23889DE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: brushed Date: Sun Jan 20 20:29:54 2013 New Revision: 1435944 URL: http://svn.apache.org/viewvc?rev=1435944&view=rev Log: 2.9.1-svn-19 [JSPWIKI-712], fixing entities encoding in change-note, author and link fields. Modified: incubator/jspwiki/trunk/ChangeLog incubator/jspwiki/trunk/src/org/apache/wiki/Release.java incubator/jspwiki/trunk/src/webdocs/Edit.jsp incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp incubator/jspwiki/trunk/src/webdocs/templates/default/editors/preview.jsp Modified: incubator/jspwiki/trunk/ChangeLog URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1435944&r1=1435943&r2=1435944&view=diff ============================================================================== --- incubator/jspwiki/trunk/ChangeLog (original) +++ incubator/jspwiki/trunk/ChangeLog Sun Jan 20 20:29:54 2013 @@ -1,3 +1,9 @@ +2013-01-20 Dirk Frederickx (brushed AT apache DOT org) + + * 2.9.1-svn-19 + + * JSPWIKI-712, fixing entities encoding in change-note, author and link fields. + 2013-01-15 Harry Metske * 2.9.1-svn-18 Modified: incubator/jspwiki/trunk/src/org/apache/wiki/Release.java URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/Release.java?rev=1435944&r1=1435943&r2=1435944&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/org/apache/wiki/Release.java (original) +++ incubator/jspwiki/trunk/src/org/apache/wiki/Release.java Sun Jan 20 20:29:54 2013 @@ -75,7 +75,7 @@ public final class Release *

* If the build identifier is empty, it is not added. */ - public static final String BUILD = "18"; + public static final String BUILD = "19"; /** * This is the generic version string you should use Modified: incubator/jspwiki/trunk/src/webdocs/Edit.jsp URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Edit.jsp?rev=1435944&r1=1435943&r2=1435944&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/webdocs/Edit.jsp (original) +++ incubator/jspwiki/trunk/src/webdocs/Edit.jsp Sun Jan 20 20:29:54 2013 @@ -14,7 +14,7 @@ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations - under the License. + under the License. --%> <%@ page import="org.apache.log4j.*" %> @@ -62,8 +62,8 @@ String cancel = request.getParameter("cancel"); String append = request.getParameter("append"); String edit = request.getParameter("edit"); - String author = findParam( pageContext, "author" ); - String changenote = findParam( pageContext, "changenote" ); + String author = TextUtil.replaceEntities( findParam( pageContext, "author" ) ); + String changenote = TextUtil.replaceEntities( findParam( pageContext, "changenote" ) ); String text = EditorManager.getEditedText( pageContext ); String link = TextUtil.replaceEntities( findParam( pageContext, "link") ); String spamhash = findParam( pageContext, SpamFilter.getHashFieldName(request) ); @@ -112,12 +112,12 @@ // // Check for session expiry // - + if( !SpamFilter.checkHash(wikiContext,pageContext) ) { return; } - + WikiPage modifiedPage = (WikiPage)wikiContext.getPage().clone(); // FIXME: I am not entirely sure if the JSP page is the @@ -159,7 +159,7 @@ if( changenote != null && changenote.length() > 0 ) { - modifiedPage.setAttribute( WikiPage.CHANGENOTE, TextUtil.replaceEntities(changenote) ); + modifiedPage.setAttribute( WikiPage.CHANGENOTE, changenote ); } else { Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp?rev=1435944&r1=1435943&r2=1435944&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp (original) +++ incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp Sun Jan 20 20:29:54 2013 @@ -14,7 +14,7 @@ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations - under the License. + under the License. --%> <%@ page language="java" pageEncoding="UTF-8"%> @@ -44,15 +44,15 @@ WikiPage wikiPage = context.getPage(); String originalCCLOption = (String)wikiPage.getAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS ); wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, "false" ); - + String usertext = EditorManager.getEditedText(pageContext); - TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, - context.getURL( WikiContext.NONE, "scripts/fckeditor/fckeditor.js" ) ); %> + TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, + context.getURL( WikiContext.NONE, "scripts/fckeditor/fckeditor.js" ) ); %> <%-- this is a new page, check if we're cloning --%> <% - String clone = request.getParameter( "clone" ); + String clone = request.getParameter( "clone" ); if( clone != null ) { WikiPage p = engine.getPage( clone ); @@ -62,7 +62,7 @@ PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION ); try - { + { if( mgr.checkPermission( context.getWikiSession(), pp ) ) { usertext = engine.getPureText( p ); @@ -82,32 +82,32 @@ <% if( usertext == null ) usertext = ""; RenderingManager renderingManager = new RenderingManager(); - + // since the WikiProperties are shared, we'll want to make our own copy of it for modifying. Properties copyOfWikiProperties = new Properties(); copyOfWikiProperties.putAll( engine.getWikiProperties() ); copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName() ); renderingManager.initialize( engine, copyOfWikiProperties ); - + String pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context, usertext ) ); - + // Disable the WYSIWYG_EDITOR_MODE and reset the other properties immediately // after the XHTML for FCK has been rendered. context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.FALSE ); context.setVariable( WikiEngine.PROP_RUNFILTERS, null ); wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption ); - + String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR ); - + String protocol = "http://"; if( request.isSecure() ) { protocol = "https://"; - } + } %> -

@@ -142,21 +142,21 @@

- +

- + />

<%--FIXME: seems not to read the email of the user, but some odd previously cached value --%>

- +

Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp?rev=1435944&r1=1435943&r2=1435944&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp (original) +++ incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp Sun Jan 20 20:29:54 2013 @@ -14,7 +14,7 @@ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations - under the License. + under the License. --%> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> @@ -35,21 +35,21 @@ <%-- This is a plain editor for JSPWiki. --%> -<% - WikiContext context = WikiContext.findContext( pageContext ); +<% + WikiContext context = WikiContext.findContext( pageContext ); WikiEngine engine = context.getEngine(); - - TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, + + TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, context.getURL( WikiContext.NONE, "scripts/jspwiki-edit.js" ) ); - TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, + TemplateManager.addResourceRequest( context, TemplateManager.RESOURCE_SCRIPT, context.getURL( WikiContext.NONE, "scripts/posteditor.js" ) ); - + String usertext = EditorManager.getEditedText( pageContext ); %> <%-- this is a new page, check if we're cloning --%> <% - String clone = request.getParameter( "clone" ); + String clone = request.getParameter( "clone" ); if( clone != null ) { WikiPage p = engine.getPage( clone ); @@ -59,7 +59,7 @@ PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION ); try - { + { if( mgr.checkPermission( context.getWikiSession(), pp ) ) { usertext = engine.getPureText( p ); @@ -82,11 +82,11 @@
<%-- Required for IE6 on Windows --%> - @@ -97,14 +97,14 @@ <%=SpamFilter.insertInputFields( pageContext )%> - - -

<%-- This following field is only for the SpamFilter to catch bots which are just randomly filling all fields and submitting. @@ -122,13 +122,14 @@ FIXME ---%> +--%> - + + - +

@@ -176,7 +177,7 @@ /> - +
@@ -205,8 +206,8 @@
-
@@ -216,13 +217,13 @@

- + />

- - + +

@@ -231,7 +232,7 @@
/> - +
Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/editors/preview.jsp URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/editors/preview.jsp?rev=1435944&r1=1435943&r2=1435944&view=diff ============================================================================== --- incubator/jspwiki/trunk/src/webdocs/templates/default/editors/preview.jsp (original) +++ incubator/jspwiki/trunk/src/webdocs/templates/default/editors/preview.jsp Sun Jan 20 20:29:54 2013 @@ -14,7 +14,7 @@ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations - under the License. + under the License. --%> <%@ page language="java" pageEncoding="UTF-8"%> @@ -30,17 +30,17 @@ <%-- This is a special editor component for JSPWiki preview storage. --%> -<% - WikiContext context = WikiContext.findContext( pageContext ); - String usertext = (String)pageContext.getAttribute( EditorManager.ATTR_EDITEDTEXT, PageContext.REQUEST_SCOPE ); - if( usertext == null ) usertext = ""; - - String action = "comment".equals(request.getParameter("action")) ? - context.getURL(WikiContext.COMMENT,context.getName()) : +<% + WikiContext context = WikiContext.findContext( pageContext ); + String usertext = (String)pageContext.getAttribute( EditorManager.ATTR_EDITEDTEXT, PageContext.REQUEST_SCOPE ); + if( usertext == null ) usertext = ""; + + String action = "comment".equals(request.getParameter("action")) ? + context.getURL(WikiContext.COMMENT,context.getName()) : context.getURL(WikiContext.EDIT,context.getName()); %> <%-- Edit.jsp & Comment.jsp rely on these being found. So be careful, if you make changes. --%> - - - - + + + + - +

- - -
- + \ No newline at end of file