This is a migrated thread and some comments may be shown as answers.

With DisableFilter(RemoveScripts) still have some <script removed when multiple <script tags exist in content

1 Answer 73 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Llad Mattie
Top achievements
Rank 1
Llad Mattie asked on 12 Apr 2010, 07:32 PM
Using version: Version 2009.3.1208 (Dec 8, 2009)

I have disabled the RemoveJavascript filter using the following code:
            RichTextEditor.DisableFilter(EditorFilters.RemoveScripts);
            RichTextEditor.DisableFilter(EditorFilters.EncodeScripts);

Now, in the UI in HTML mode I paste in the following code:
<script type="text/javascript" src="http://cdn.widgetserver.com/syndication/subscriber/InsertWidget.js"></script><script>if (WIDGETBOX) WIDGETBOX.renderWidget('ea4c7da5-c69b-4b5d-be46-c584cc005caf');</script><noscript>Get the <a href="http://www.widgetbox.com/widget/magic8ball">Magic 8 Ball</a> widget and many other <a href="http://www.widgetbox.com/">great free widgets</a> at <a href="http://www.widgetbox.com">Widgetbox</a>! Not seeing a widget? (<a href="http://docs.widgetbox.com/using-widgets/installing-widgets/why-cant-i-see-my-widget/">More info</a>)</noscript>

Click Save and the radEditor's contents at the server are:
<script type="text/javascript" src="http://cdn.widgetserver.com/syndication/subscriber/InsertWidget.js"></script>

Can someone explain to me why the other script content has been removed?

Thank you,

Llad








1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Apr 2010, 02:26 PM
Hello Llad Mattie,

You should not disable the EncodeScripts filter because the script gets executed when switching to HTML mode or submitting the content which produce a JavaScript error, which causes the reported problem. In your scenario you should only disable the RemoveScripts filter:

RichTextEditor.DisableFilter(EditorFilters.RemoveScripts);

Regards,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Llad Mattie
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or