Increase max allowed characters with HTML from 1000000.

130 views
Skip to first unread message

Harshita Gupta

unread,
Aug 10, 2020, 9:21:08 AM8/10/20
to Sakai Development

HTML content size.PNG

Can we increase max allowed characters with HTML from 1000000 in rich text box. If yes then how ?

Your help is highly appreciated. 

Earle Nietzel

unread,
Aug 10, 2020, 11:03:18 AM8/10/20
to Harshita Gupta, Sakai Development
The RTE in Sakai is used in many locations and there is no way to currently effect them all, however given your in the lessons tool this maybe the location:

as it's the only one with a limit in lessons for the type materialized_clob so you could simply remove the length.

-earle


--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/addb0cd3-8dad-4563-9947-b3ea4fa2a34eo%40apereo.org.

Harshita Gupta

unread,
Aug 10, 2020, 2:28:16 PM8/10/20
to Sakai Development, harshita....@gmail.com
Thanks Earle!

I tried this solution however I am getting below Error : 

10-Aug-2020 23:45:00.804 ERROR [http-nio-8080-exec-6] org.sakaiproject.util.impl.FormattedTextImpl.processFormattedText processFormattedText: Failure during scan of input html: org.owasp.validator.html.ScanException: The input was too large. The specified input was 1,326,290 bytes and the maximum is 1,000,000 bytes.
org.owasp.validator.html.ScanException: The input was too large. The specified input was 1,326,290 bytes and the maximum is 1,000,000 bytes.
        at org.owasp.validator.html.scan.AntiSamySAXScanner.scan(AntiSamySAXScanner.java:101)
        at org.owasp.validator.html.scan.AntiSamySAXScanner.scan(AntiSamySAXScanner.java:89)
        at org.owasp.validator.html.AntiSamy.scan(AntiSamy.java:129)
        at org.owasp.validator.html.AntiSamy.scan(AntiSamy.java:75)
        at org.sakaiproject.util.impl.FormattedTextImpl.processFormattedText(FormattedTextImpl.java:395)
        at org.sakaiproject.util.impl.FormattedTextImpl.processFormattedText(FormattedTextImpl.java:313)
        at org.sakaiproject.util.FormattedText.processFormattedText(FormattedText.java:67)
        at org.sakaiproject.lessonbuildertool.tool.beans.SimplePageBean.submit(SimplePageBean.java:1218)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at uk.org.ponder.reflect.JDKReflectiveCache.invokeMethod(JDKReflectiveCache.java:34)
        at uk.org.ponder.reflect.JDKReflectiveCache.invokeMethod(JDKReflectiveCache.java:22)
        at uk.org.ponder.reflect.JDKReflectiveCache.invokeMethod(JDKReflectiveCache.java:92)
        at uk.org.ponder.reflect.ReflectiveCache.invokeMethod(ReflectiveCache.java:146)
        at uk.org.ponder.mapping.support.DARApplier.invokeBeanMethod(DARApplier.java:180)
        at uk.org.ponder.rsf.state.support.RSVCApplier.invokeAction(RSVCApplier.java:218)
        at uk.org.ponder.rsf.processor.support.RSFActionHandler$1.run(RSFActionHandler.java:189)
        at uk.org.ponder.util.CollectingRunnableInvoker$1.run(CollectingRunnableInvoker.java:25)
        at uk.org.ponder.rsf.flow.support.BasicScopedAlterationWrapper.invokeRunnable(BasicScopedAlterationWrapper.java:59)
        at uk.org.ponder.rsf.flow.support.BasicScopedAlterationWrapper$$FastClassBySpringCGLIB$$84f89202.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:667)
        at uk.org.ponder.rsf.flow.support.BasicScopedAlterationWrapper$$EnhancerBySpringCGLIB$$497bbcf7.invokeRunnable(<generated>)
        at uk.org.ponder.rsf.flow.support.BasicScopedAlterationWrapper$$FastClassBySpringCGLIB$$84f89202.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:667)
        at uk.org.ponder.rsf.flow.support.BasicScopedAlterationWrapper$$EnhancerBySpringCGLIB$$497bbcf7.invokeRunnable(<generated>)
        at uk.org.ponder.util.CollectingRunnableInvoker$1.run(CollectingRunnableInvoker.java:29)
        at uk.org.ponder.util.CollectingRunnableInvoker.invokeWrappers(CollectingRunnableInvoker.java:32)
        at uk.org.ponder.util.CollectingRunnableInvoker.invokeRunnable(CollectingRunnableInvoker.java:14)
        at uk.org.ponder.rsf.processor.support.RSFActionHandler.handle(RSFActionHandler.java:165)
        at uk.org.ponder.rsf.processor.support.RSFActionHandler$$FastClassBySpringCGLIB$$e3b6899d.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:667)
        at uk.org.ponder.rsf.processor.support.RSFActionHandler$$EnhancerBySpringCGLIB$$f3d3bca8.handle(<generated>)
        at uk.org.ponder.rsf.processor.support.RootHandlerBeanBase.handlePost(RootHandlerBeanBase.java:125)
        at uk.org.ponder.rsf.processor.support.RootHandlerBeanBase.handle(RootHandlerBeanBase.java:82)
        at org.sakaiproject.lessonbuildertool.util.RootHandlerBeanOverride.handle(RootHandlerBeanOverride.java:43)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at uk.org.ponder.reflect.JDKReflectiveCache.invokeMethod(JDKReflectiveCache.java:34)
        at uk.org.ponder.reflect.JDKReflectiveCache.invokeMethod(JDKReflectiveCache.java:22)
        at uk.org.ponder.reflect.JDKReflectiveCache.invokeMethod(JDKReflectiveCache.java:92)
        at uk.org.ponder.rsac.support.RSACBeanLocatorImpl.createBean(RSACBeanLocatorImpl.java:553)
        at uk.org.ponder.rsac.support.RSACBeanLocatorImpl.access$000(RSACBeanLocatorImpl.java:75)
        at uk.org.ponder.rsac.support.RSACBeanLocatorImpl$1.run(RSACBeanLocatorImpl.java:449)
        at uk.org.ponder.rsac.RSACErrorBridge.invokeRunnable(RSACErrorBridge.java:38)
        at uk.org.ponder.rsac.support.RSACBeanLocatorImpl.createBean(RSACBeanLocatorImpl.java:447)
        at uk.org.ponder.rsac.support.RSACBeanLocatorImpl.getLocalBean(RSACBeanLocatorImpl.java:348)
        at uk.org.ponder.rsac.support.RSACBeanLocatorImpl.getBean(RSACBeanLocatorImpl.java:379)
        at uk.org.ponder.rsac.support.PerRequestInfo$1.locateBean(PerRequestInfo.java:49)
        at org.sakaiproject.rsf.servlet.ReasonableSakaiServlet.service(ReasonableSakaiServlet.java:89)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:426)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
        at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:508)
        at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1500)
        at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1253)
        at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1087)
        at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:499)
        at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:275)
        at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:163)
        at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:69)
        at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1173)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:475)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)


On Monday, August 10, 2020 at 8:33:18 PM UTC+5:30, Earle Nietzel wrote:
The RTE in Sakai is used in many locations and there is no way to currently effect them all, however given your in the lessons tool this maybe the location:

as it's the only one with a limit in lessons for the type materialized_clob so you could simply remove the length.

-earle


On Mon, Aug 10, 2020 at 9:21 AM Harshita Gupta <harshita...@gmail.com> wrote:

HTML content size.PNG

Can we increase max allowed characters with HTML from 1000000 in rich text box. If yes then how ?

Your help is highly appreciated. 

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to saka...@apereo.org.

Harshita Gupta

unread,
Aug 10, 2020, 2:35:32 PM8/10/20
to Sakai Development
I have also tried increasing value at below location : 

kernel/kernel-impl/src/main/resources/antisamy/high-security-policy.xml
#L14:    <directive name="maxInputSize" value="1000000" /><!-- default of 100k -->

kernel/kernel-impl/src/main/resources/antisamy/low-security-policy.xml
#L14:    <directive name="maxInputSize" value="1000000" /><!-- default of 100k -->

library/src/webapp-filtered/editor/ckeditor.launch.js
#L204:            "maxCharCount" : 1000000,

changed 1000000 to 100000000, This also didn't fix the issue. 

Matthew Jones

unread,
Aug 10, 2020, 2:46:05 PM8/10/20
to Harshita Gupta, Sakai Development
That value is hardcoded in the ckeditor.launch.js file

So you'd have to change that and also change the 2 AntiSamy files you mention.

Note there are *many* text areas in Sakai that have a different set limits on the database and still might not let you insert as many characters and cause another exception. I think we just set 1 million characters as a "safe limit", but I probably wouldn't go any higher than around ~5.5 million which is the MySQL MEDIUMTEXT limit for 3 byte characters without checking the database. I'd have to inspect the database to see how many fields are set to which type.

For instance I was working on this PR which actually limits some Samigo fields to 32000 characters in those cases: https://github.com/sakaiproject/sakai/pull/8392. Ideally each tool would be able to customize its own limits.

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/9489ed26-c985-4206-a9fe-7fe41e8d7782o%40apereo.org.

Matthew Jones

unread,
Aug 10, 2020, 2:46:49 PM8/10/20
to Harshita Gupta, Sakai Development
You may want to make sure your cache is cleared after changing and re-deploying the ckeditor.launch.js file. 
Reply all
Reply to author
Forward
0 new messages