Jump to content

Javascript in description source code


Recommended Posts

I am confused how to edit my source code in a description when I have JS in it. It seems to turn all the script into something that makes no sense to me. So how do I edit the JS after the description is saved?

	</tr>
	</tbody>
</table>
<!--{cke_temp_711485536}

<p>0--&gt;</p>

above is an example. that was script before I saved it.

Link to comment
Share on other sites

Please examine the file /includes/ckeditor/config.js, and determine if this line appears exactly as follows:

config.protectedSource = [/{\S*?.*?\S}/g];

If so, then this could be related to #3573, where a meta tag (well, possibly others) has been determined to be illegal. But I do think script tags are legal.

If not, then review the Github issue #3427.

  • Like 1
Link to comment
Share on other sites

I saw another merchants with scrip tag problems since the latest update. He has a simple bit of JS like which failed. I think we're going to have to roll back to an older version of CKEditor. This had open and close script tags with a variable declared for the page layout which was then picked up elsewhere to manipulate the page.

 

Link to comment
Share on other sites

Hi Al, I am not sure I have the older version of ckeditor you are referring too. I simply update and remove setup folders. Or lately with managed hosting from you I think you update for me?

DLLPDF.com

I see #3573 has been closed with a mention of 6.5.6? Does this mean we simply need to update our stores?

Link to comment
Share on other sites

I have been scouring the CKEditor code and, while I haven't found it just yet, I believe they decided in the recent releases that script tags will not be allowed at all - no matter what! But the visual result is confusing.

See:

https://securitylab.github.com/advisories/GHSL-2022-009_ckeditor4/

 

Link to comment
Share on other sites

So far, this is the best I could come up with:

Using Smarty syntax to break apart the tag 'script':
<pre>
{'<scrip'}{'t>'}
{'var x="Hello.";'}
{'</scrip'}{'t>'}
</pre>

It's fugly as sin, and will require the admin to know about this trick, and to manage the quotes appropriately.

 

Link to comment
Share on other sites

So to do this I assume every line of the script would need {'.......'}?

Yes that is REALLY fugly.

Is there a better way for me to do this (almost certain there is). Like can I save the script on the server somewhere and call it for my page? The reason I wanted to embed it directly in the page was to be able to update it easily from an admin stand point like when constants need to change such as price or something.

For now I guess I will continue to build the code outside the page then figure out how to make it a product.

Link to comment
Share on other sites

Al, How do I get the correct one?

Is it buried somewhere in my files or do you have a copy somewhere? Can you replace it for main my main and my dev site?

dllpdf.com  and dev.dllpdf.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...