Revision: 2590
http://sourceforge.net/p/gatewiki/code/2590
Author: ian_roberts
Date: 2024-08-19 12:10:33 +0000 (Mon, 19 Aug 2024)
Log Message:
-----------
Completely disable and remove fckeditor, it isn't used for anything any more and is not worth the known vulnerabilities
Modified Paths:
--------------
trunk/cow/grails-app/controllers/PageController.groovy
trunk/cow/grails-app/views/page/edit/edit.gsp
Removed Paths:
-------------
trunk/cow/grails-app/taglib/FckEditorTagLib.groovy
trunk/cow/web-app/js/fckeditor/
Modified: trunk/cow/grails-app/controllers/PageController.groovy
===================================================================
--- trunk/cow/grails-app/controllers/PageController.groovy 2024-01-19 11:50:10 UTC (rev 2589)
+++ trunk/cow/grails-app/controllers/PageController.groovy 2024-08-19 12:10:33 UTC (rev 2590)
@@ -420,6 +420,8 @@
return binary()
}
+ /* rich editor no longer supported */
+ /*
// choose the right editor
// If params has an explicit rich=0 or rich=1, respect that
if(params.containsKey('rich')) {
@@ -444,6 +446,8 @@
}
}
}
+ */
+ flow.rich = false
// make copies / checkouts as appropriate
pageService.prepareEdit(flow.asMap())
@@ -473,6 +477,7 @@
flow.commitMessage = params.commitMessage
log.debug("edit -> save")
}.to "save"
+ /*
on("rich") {
flow.action = "edit"
switchEditorType(true, response)
@@ -481,6 +486,7 @@
flow.action = "edit"
switchEditorType(false, response)
}.to "normalExit"
+ */
on("cancel") {
pageService.cancelEdit(flow.asMap())
flow.message = message(
Deleted: trunk/cow/grails-app/taglib/FckEditorTagLib.groovy
===================================================================
--- trunk/cow/grails-app/taglib/FckEditorTagLib.groovy 2024-01-19 11:50:10 UTC (rev 2589)
+++ trunk/cow/grails-app/taglib/FckEditorTagLib.groovy 2024-08-19 12:10:33 UTC (rev 2590)
@@ -1,91 +0,0 @@
-/* Copyright 2004-2005 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT c;pWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * A tag for the FCK editor, derived from Grails' UITagLib in version 0.5.6.
- *
- * @author Graeme Rocher
- * @since 24-March-2006
- */
-class FckEditorTagLib {
- /**
- * A Rich Text Editor component that by default uses fckeditor with a basepath of /fckeditor.
- *
- * Example:
- * <g:richTextEditor name="editor" height="400" />
- */
- def richTextEditor = { attrs ->
- out << withTag(name:'script',attributes:[type:'text/javascript']) {
- if(attrs.onComplete) {
- out.println "function FCKeditor_OnComplete( editorInstance ) {"
- out.println "${attrs.onComplete}(editorInstance);"
- out.println "}"
- }
- out << """
- var oFCKeditor = new FCKeditor( '${attrs.name.encodeAsJavaScript()}' ) ;
- oFCKeditor.BasePath = \""""
- if(attrs.basepath) {
- out << g.resource(dir:attrs.basepath)
- }
- else {
- out << g.resource(dir:"fckeditor/")
- }
- out.println '";'
- if(attrs.toolbar) {
- out.println "oFCKeditor.ToolbarSet = '${attrs.toolbar.encodeAsJavaScript()}';"
- }
- // add width support
- if(attrs.width)
- out.println "oFCKeditor.Width = '${attrs.width.encodeAsJavaScript()}';"
-
- if(attrs.height)
- out.println "oFCKeditor.Height = '${attrs.height.encodeAsJavaScript()}';"
-
- // add skin support, values to choose: "default", "office2003", "silver"
- if(attrs.skin)
- out.println "oFCKeditor.Config['SkinPath'] = 'skins/${attrs.skin.encodeAsJavaScript()}/';"
-
- // check the browser compatibility when rendering the editor. default value: true, values to choose: true, false,
- if(attrs.checkBrowser)
- out.println "oFCKeditor.CheckBrowser = ${attrs.checkBrowser};"
-
- // show error messages on errors while rendering the editor. default value: true, values to choose: true, false
- if(attrs.displayErrors)
- out.println "oFCKeditor.DisplayErrors = ${attrs.displayErrors};"
-
- // oFCKeditor.Config AutoDetectLanguage:true/false, DefaultLanguage:'pt-BR' and so on
- if(attrs.config) {
- if (attrs.config instanceof Map) {
- attrs.config.each { k, v ->
- out.println "oFCKeditor.Config['${k.toString().encodeAsJavaScript()}'] = '${v?.toString().encodeAsJavaScript()}';"
- }
- } else {
- throw new Exception("""The format of config is not correct, it should be like "[AutoDetectLanguage:false, DefaultLanguage:'pt-BR']" """)
- }
- }
-
-
- if(attrs.value) {
- out << "oFCKeditor.Value = \'"
- out << attrs.value.encodeAsJavaScript()
- out.println "\' ;"
- }
-
- out.println "oFCKeditor.Create();"
-
- }
- }
-
-}
Modified: trunk/cow/grails-app/views/page/edit/edit.gsp
===================================================================
--- trunk/cow/grails-app/views/page/edit/edit.gsp 2024-01-19 11:50:10 UTC (rev 2589)
+++ trunk/cow/grails-app/views/page/edit/edit.gsp 2024-08-19 12:10:33 UTC (rev 2590)
@@ -3,10 +3,12 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<g:layoutLink id="${id}"/>
<g:cowTitle pageName="Edit ${pagePath}" />
+ <%--
<g:if test="${rich}">
<script type="text/javascript"
src="${createLinkTo(dir:'js/fckeditor', file:'fckeditor.js')}" />
</g:if>
+ --%>
</head>
<body>
<h1>Edit wiki page: ${pagePath}</h1>
@@ -24,6 +26,7 @@
</div>
</g:if>
+ <%--
<g:if test="${rich}">
<form action="${pageURI(action:'edit', id:id, linkPath:pagePath, query:'rich=1')}"
method="post">
@@ -56,7 +59,8 @@
/>
</form>
</g:if>
- <g:else>
+ --%>
+ <%-- g:else --%>
<div class="editForm">
<form action="${pageURI(action:'edit', id:id, linkPath:pagePath)}" method="post">
<input type="hidden" name="execution" value="${request['flowExecutionKey']}" id="execution" />
@@ -65,9 +69,9 @@
<tr><td>
<span class="button"><g:submitButton name="preview" value="Preview" /></span>
<span class="button"><g:submitButton name="save" value="Save" /></span>
- <!--
+ <%--
<span class="button"><g:submitButton name="rich" value="Switch to WYSIWYG editor" /></span>
- -->
+ --%>
<span class="button"><g:submitButton name="cancel" value="Cancel" /></span>
<cow:isServer>
<span>Log message: <g:textField size="50" name="commitMessage" value="${commitMessage}" /></span>
@@ -85,7 +89,7 @@
</table>
</form>
</div>
- </g:else>
+ <%-- /g:else --%>
<g:if test="${editType == pageConf.YAM_FORM_EDIT}">
<hr/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|