Opened 17 years ago

Closed 17 years ago

#782 closed Bug (duplicate)

ProtectedSource: Stack overflow at line 23

Reported by: amathur347@… Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: SF Cc:

Description

This error has been reported atleast 20 times, but all tickets have been closed without resolution. I could not find a way to reopen it, so I am creating a new one.

Basically the issue is this -

I am getting a stack overflow error when I submit content that is a little complicated, with tables and images. In Firefox, I get a error : Too much recursion in line 22. I have traced the error to the following lines in fck_startup.js

var FCKConfig=FCK.Config=new Object();if
(document.location.protocol=='file:')
{FCKConfig.BasePath=unescape
(document.location.pathname.substr
(1));FCKConfig.BasePath=FCKConfig.BasePath.replace(/
\\/gi, '/');FCKConfig.BasePath='file://'+FCKConfig.Bas
ePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')
+1);}else
{FCKConfig.BasePath=document.location.pathname.substri
ng(0,document.location.pathname.lastIndexOf('/')
+1);FCKConfig.FullBasePath=document.location.protocol+
'//'+document.location.host+FCKConfig.BasePath;};FCKCo
nfig.EditorPath=FCKConfig.BasePath.replace(/editor\/
$/,'');try
{FCKConfig.ScreenWidth=screen.width;FCKConfig.ScreenHe
ight=screen.height;}catch (e)
{FCKConfig.ScreenWidth=800;FCKConfig.ScreenHeight=600;
};FCKConfig.ProcessHiddenField=function()
{this.PageConfig=new Object();var
A=window.parent.document.getElementById
(FCK.Name+'___Config');if (!A) return;var
B=A.value.split('&');for (var i=0;i<B.length;i++){if
(B[i].length==0) continue;var C=B[i].split('=');var
D=unescape(C[0]);var E=unescape(C[1]);if
(D=='CustomConfigurationsPath') FCKConfig[D]=E;else
if (E.toLowerCase()=="true") this.PageConfig[D]
=true;else if (E.toLowerCase()=="false")
this.PageConfig[D]=false;else if (!isNaN(E))
this.PageConfig[D]=parseInt(E);else this.PageConfig[D]
=E;};};FCKConfig.LoadPageConfig=function(){for (var A
in this.PageConfig) FCKConfig[A]=this.PageConfig
[A];};FCKConfig.ToolbarSets=new Object
();FCKConfig.Plugins=new Object
();FCKConfig.Plugins.Items=new Array
();FCKConfig.Plugins.Add=function(A,B,C)
{FCKConfig.Plugins.Items.addItem
([A,B,C]);};FCKConfig.ProtectedSource=new Object
();FCKConfig.ProtectedSource.RegexEntries=new Array
();FCKConfig.ProtectedSource.Add=function(A)
{this.RegexEntries.addItem
(A);};FCKConfig.ProtectedSource.Protect=function(A)
{function _Replace(protectedSource){var
B=FCKTempBin.AddElement(protectedSource);return '<!--
{PS..'+B+'}-->';};for (var
i=0;i<this.RegexEntries.length;i++){A=A.replace
(this.RegexEntries[i],_Replace);};return
A;};FCKConfig.ProtectedSource.Revert=function(A,B)
{function _Replace(m,opener,index){var C=B?
FCKTempBin.RemoveElement(index):FCKTempBin.Elements
[index];return FCKConfig.ProtectedSource.Revert
(C,B);};return A.replace(/(<|&lt;)!--\{PS..(\d+)\}--
(>|&gt;)/g,_Replace);};FCKConfig.ProtectedSource.Add
(/<!--[\s\S]*?-->/g);
var FCKeditorAPI;function FCKeditorAPI_GetInstance
(instanceName){return this.__Instances
[instanceName];};if (!window.parent.FCKeditorAPI)
{FCKeditorAPI=window.parent.FCKeditorAPI=new Object
();FCKeditorAPI.__Instances=new Object
();FCKeditorAPI.Version='2.2';FCKeditorAPI.GetInstance
=FCKeditorAPI_GetInstance;}else
FCKeditorAPI=window.parent.FCKeditorAPI;FCKeditorAPI._
_Instances[FCK.Name]=FCK;

Moved from SF:
http://sourceforge.net/tracker/index.php?func=detail&aid=1570151&group_id=75348&atid=543653

Change History (2)

comment:1 Changed 17 years ago by Martin Kou

Reporter: changed from Martin Kou to amathur347@…

Great ! I removed the <! PS > thing and it works ! Not sure why it was there though. Anyway, you say there is a fix planned in the next release. Thats good enough for me.

By the way fredk, thanks for your prompt responce.


Moved from SF. Original poster: Anonymous

The same thing here... you have a <!--{PS..0}--> in the code, which is an internal code used by the ProtectedSource system. For some reason it is there, much probably because you have used innerHTML to retrieve the editor contents.

Even if it is a DUP, I'm reopening it because of the TC. A fix for it is planned for version 2.4.

Thanks for the cooperation.


Moved from SF. Original poster: fredck

here it is


Moved from SF. Original poster: amathur347

This issue is not related with the server side page which creates the editor instance. It is more related to the content loaded in the editor.

So, the important here is having some source HTML to load in the editor that, when loaded, breaks the editor. Based on your sample, we are looking for the real value of $page_infobody?. Please attach its value to a txt file in the report.

Regarding the bugs list, just 1380192 and 1540332 seam to be related (duplicates), but we had no more info from the reporter, so they have been closed because of the lack of information.


Moved from SF. Original poster: fredck

The list of similar bugs reported..

1399084 1570151 1380192 1540332

Ok its not 20.. but there are a few!


Moved from SF. Original poster: amathur347

I am using this in a smarty environment.

This is from the php file

$page_info = $cmslib->GetPageInfo($pageid);

$oFCKeditor = new FCKeditor('body') ;
$oFCKeditor->BasePath = '../FCKeditor/' ;
$oFCKeditor->Width='700';
$oFCKeditor->Height='250';
$oFCKeditor->Value		= $page_info['body'] ;
$body = $oFCKeditor->CreateHtml() ;
  $smarty->assign('pagetitle',$page_info["title"]);
  $smarty->assign('heading',$page_info["heading"]);
  $smarty->assign('body',$page_info["body"]);
  $smarty->assign('picfile',$page_info["picfile"]);
  $smarty->assign('menuhdimg',$page_info["menuhdimg"]);


$smarty->assign('body',$body);

in templates

{?body}

Moved from SF. Original poster: amathur347

Please provide a samples source HTML to paste in the editor to see the problem.

Also, please list the 20 pages reporting the same problem. I'm curious about it.


Moved from SF. Original poster: fredck

DUP: 1353126


Moved from SF. Original poster: fredck

comment:2 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Resolution: duplicate
Status: newclosed

dup of #143

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy