AppGini Modifying embed code

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

AppGini Modifying embed code

Post by rpierce » 2022-02-26 05:38

I have two fields formatted as rich text/html. I use these fields to paste a map embed code. The problem I'm having is that whenever I make any changes in the table and save changes, the embed code is changed by the app.

The embed code should look like this:
<iframe src="https://www.google.com/maps/d/embed?mid ... hbc=2E312F" width="640" height="480"></iframe>

But whenever I save changes in the app the embed code is changed to this:
<iframe sandbox="" src="https://www.google.com/maps/d/embed?mid ... hbc=2E312F" width="640" height="480"></iframe>

The maps show just fine if I enter them directly into the fields via PhpMyAdmin. But, if a make any changes to anything in the table and save changes, the embed code is changed. I have tried other text formats with no luck.

I don't want to use Google Maps. I use MyMaps which is a Google tool also but is much more preferable to me.

Please help....

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: AppGini Modifying embed code

Post by rpierce » 2022-02-26 18:50

My experimenting shows that every time I make a change in the app the word "sandbox" is added to my embed code? This word is added every time I save changes. Hopefully someone can guide me to eliminate this.

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: AppGini Modifying embed code

Post by rpierce » 2022-02-26 19:34

Update: I reverted to Version 5.98 and the problem persists. I then reverted to version 5.97 and the problem is gone.

User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

Re: AppGini Modifying embed code

Post by ronwill » 2022-02-27 13:18

Might not be solution to your problem but I had an issue with embedding on my text editor (CK Editor) that I use instead of NICEDIT, code was being altered. It was also happened between version 5.97 & 5.98

See: viewtopic.php?f=11&t=4224&p=16706#p16706

As said might not be related but maybe worth a try to edit your ci_input.php file by removing the 'style' entries?
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: AppGini Modifying embed code

Post by rpierce » 2022-02-28 03:04

Thank you, I'll look at that.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: AppGini Modifying embed code

Post by peebee » 2022-03-01 04:47

Sandbox is a security attribute for iframe: https://developer.mozilla.org/en-US/doc ... tr-sandbox

In Appgini V22.11 the (new) sandbox attribute appears to be added in admin/IncFunctions.php in this function:

Code: Select all

                // sandbox iframes
		$str = preg_replace('/(<|&lt;)iframe(.*?)(>|&gt;)/i', '$1iframe sandbox $2$3', $str);
The sandbox attribute that is added to the <iframe> doesn't appear to have any values and that would be preventing your iframe from displaying.

I'm not sure which sandbox value is missing that's preventing your iframe from displaying but you could try editing the code I mentioned above in admin/incFunctions.php as follows. This will allow just about everything. Try deleting values until you have what's required?

Code: Select all

                // sandbox iframes
		$str = preg_replace('/(<|&lt;)iframe(.*?)(>|&gt;)/i', '$1iframe sandbox="allow-modals allow-forms allow-scripts allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox" $2$3', $str);
Hopefully that might help?

PS: Don't forget you'll need to replace/edit that file again if you ever regenerate your app.

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: AppGini Modifying embed code

Post by rpierce » 2022-03-02 15:24

It's not that the app is simply adding "sandbox", but that it gets added every time I save changes in the table. So, for instance, if I save changes five times, the word "sandbox is injected into the <iframe> code five times as well. That breaks the embed code. Once for "sandbox is fine, but every time I save changes has got to be a bug.

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: AppGini Modifying embed code

Post by rpierce » 2022-03-02 18:41

Using Notepad++ and doing a word search for "iframe" or "sandbox" in the admin/incFunctions.php file, I get no results. Are you sure it's that file? Also, I'm using ver. 22.12

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: AppGini Modifying embed code

Post by rpierce » 2022-03-05 04:10

This is what is happening when I use Version 22.12. Each time changes are made in a table the word "sandbox" gets inserted into the iframe embed code. It's a real pain.
Capture.JPG
Capture.JPG (34.4 KiB) Viewed 2425 times

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: AppGini Modifying embed code

Post by rpierce » 2022-03-05 16:52

I stand corrected! I realized that on one computer I have been using the reverted Version 5.97 and on my office computer the 22.12 version. The 5.97 version that I was doing the search on didn't have the string in the incFunctions.php you detailed.

But I did locate it in ver 22.12 and commented out the sandbox line and viola, it works! It would be a nice fix for Ahmed to add in the next version, as I like the new 22.12. Thank you for your help....

Ray

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: AppGini Modifying embed code

Post by peebee » 2022-03-07 03:11

Yes, having tested I now see what you mean about the multiple sandbox being added on each save.

Agreed, that would be a bug.

Post Reply