Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embed iframe object HTML tag NOT working? 编辑器嵌入iframe object #287

Open
hoogw opened this issue Oct 23, 2018 · 2 comments
Open

Comments

@hoogw
Copy link

hoogw commented Oct 23, 2018

I try to embed a iframe in editor. but it would not save to database.

If I close it, then re-open the post, the html iframe is missing.

Do you know why? How to fix it?

I try to embed <object type="text/html" data="http://j2t.transparentgov.net/folder.html?url=https://geodata.epa.gov/arcgis/rest/services"width="600"height="600"></object>

<object type="text/html" data="http://j2t.transparentgov.net/folder.html?url=https://geodata.epa.gov/arcgis/rest/services"
width="600"
height="600"

@hoogw
Copy link
Author

hoogw commented Oct 23, 2018

I found solution. 2 steps.

  1. 添加你的iframe src 域名到白名单过滤器
    C:\Apache24\htdocs\glassgov1\common.php

open common.php, search "iframe", add your iframe src domain to white filter.

I add **'j2t.transparentgov.net', 'transparentgov.net', 'www.transparentgov.net',
            'ms1.transparentgov.net',**   

 to  **$hostWhiteList**

//跨站脚本白名单过滤 function XssEscape($html) { $filter = new WhiteHTMLFilter(); $urlFilter = function($url) { $token = parse_url($url); if (empty($token['scheme']) || in_array($token['scheme'], array('http', 'https')) === false) { return ''; } $hostWhiteList = array( 'j2t.transparentgov.net', 'transparentgov.net', 'www.transparentgov.net', 'ms1.transparentgov.net', 'www.youtube.com', 'youtube.com', 'www.youtu.be', 'youtu.be', 'player.youku.com', 'v.youku.com',

2)ueditor config 添加 iframe 元素,object 元素。
C:\Apache24\htdocs\glassgov1\static\editor\ueditor.config.js

Open ueditor.config.js, add below 3 line code at : window.UEDITOR_CONFIG = { )

            // allow embed iframe tag
            ,iframe: ['frameborder','src','width','height']
            ,object: ['type','data','width','height']

// allow embed iframe tag ,iframe: ['frameborder','src','width','height'] ,object: ['type','data','width','height']

Success embed iframe, object html tag

@hoogw hoogw changed the title embed HTML function NOT working? embed iframe object HTML tag NOT working? 编辑器嵌入iframe object Oct 23, 2018
@asleep2
Copy link

asleep2 commented Dec 19, 2018

@hoogw nginx呢?怎么操作

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants