wysiwyg

best way to secure simple wysiwyg with php

喜夏-厌秋 提交于 2019-12-01 04:00:14
i have added a simple wysiwyg editor in my website. (it only allows B / I / U - no more) I currently store all content as html in my database - but atm it's simple to add <a onclick='...'> or other malicious code) Whats the best way in PHP to parse the input safely? How to implement <b></b> <i></i> and so on as whitelist and encode everything else? Layke HTMLPurifier I'm just going to throw this one out there and probably get the inevitable lashing. I would not use strip_tags to secure your WYSIWYG form... ever (Unless you want to piss off your users). It won't secure your form, and you may be

How to add a non editable tag to content in Quill editor

别来无恙 提交于 2019-12-01 03:42:34
I want to add a couple of pre-built labels like <div class="label"> Label Text <span>x</span><div> to the html content in the quill editor. Add such a tag should not be a problem in itself. However I don't want the user to be able to edit the text inside the label. The cursor should not even be allowed to be placed inside the label. On delete the whole div should be deleted. The whole label should act like an image in some sense. Is it possible ? You should be able to achieve this by writing your own Blot : class Label extends Parchment.Embed { static create(value) { const node = super.create

best way to secure simple wysiwyg with php

我只是一个虾纸丫 提交于 2019-12-01 02:27:01
问题 i have added a simple wysiwyg editor in my website. (it only allows B / I / U - no more) I currently store all content as html in my database - but atm it's simple to add <a onclick='...'> or other malicious code) Whats the best way in PHP to parse the input safely? How to implement <b></b> <i></i> and so on as whitelist and encode everything else? 回答1: HTMLPurifier I'm just going to throw this one out there and probably get the inevitable lashing. I would not use strip_tags to secure your

wymeditor cannot save inserted iframe

旧街凉风 提交于 2019-12-01 01:44:34
问题 WymEditor (http://wymeditor.org) always deletes inserted iframe to its content. So i cannot add vimeo player block to my page. How can I avoid it? Regards, Alexey Zakharov 回答1: Since May 31, 2011, the WYMeditor Embed Plugin supports iframe embedding. To include this support, simply include the embed plugin script in your HTML. Eg. <script type="text/javascript" src="path/to/wymeditor/plugins/embed/jquery.wymeditor.embed.js"></script> 来源: https://stackoverflow.com/questions/3634616/wymeditor

Joomla 3 can't add <script> to article

时光总嘲笑我的痴心妄想 提交于 2019-11-30 20:22:32
Joomla version: Joomla! 3.3.6 Stable [ Ember ] 01-October-2014 02:00 GMT I want add js script to one my article. I'm using TinyMCE editor to edit article. In TinyMCE plugin field Prohibited Elements I filled with dummy text, now it contains "cms123", I removed "script,applet,iframe". I checked Global Configurations -> Text Filters for Super Users I have set it "No Filtering". But when I'm trying to save my article with js code, joomla removes my tags <script> from my article, also I checked with <iframe> , joomla replaced this tag with <i-frame> tag... I'm really confused, I can't understand

Paste from MS Word into Textarea

a 夏天 提交于 2019-11-30 19:45:16
I'm using https://github.com/akzhan/jwysiwyg/ and i want to implement pasting from Word, but I'm not sure what to look for and how to handle it. Im more looking for a regex pattern or a list of characters to catch and what to replace them with. Ideas? I ended up using this: // Replaces commonly-used Windows 1252 encoded chars that do not exist in ASCII or ISO-8859-1 with ISO-8859-1 cognates. var replaceWordChars = function(text) { var s = text; // smart single quotes and apostrophe s = s.replace(/[\u2018|\u2019|\u201A]/g, "\'"); // smart double quotes s = s.replace(/[\u201C|\u201D|\u201E]/g, "

iPad compatible HTML Wysiwyg editor [closed]

回眸只為那壹抹淺笑 提交于 2019-11-30 18:57:01
Are there any iPad compatible wysiwyg HTML editors? Edit: What I'm looking for is something that would work on a web app, not a native iPad app. I think that the GDocs editor might work, but keep in mind that there's almost no editor like that, they are managing everything by themselves. The rest of editors try to use contentEditable, and Apple itself warns against using it with the iPad: http://developer.apple.com/library/ios/technotes/tn2010/tn2262/#//apple_ref/doc/uid/DTS40009577-CH1-DontLinkElementID_7 Abhishek I would advise you to use NicEditor which has an option of using content

can't add youtube video to ckeditor when switching to bbcode

烂漫一生 提交于 2019-11-30 17:23:33
问题 I installed ckeditor and had it set by default to html output, and i managed to add youtube video by clicking flash button and putting youtube link like so: http://www.youtube.com/v/G6Na--PE9Yo now i switched to bbcode, and when i do the same thing it's not working. i even tried with a YouTube plugin but still not working. If you know how to fix it I would love to hear. i have a lead but i don't know how to to this. when ever someone putting youtube link, I want it to replace it to this

WYSIWYG in Android webview

自古美人都是妖i 提交于 2019-11-30 15:54:35
I've been trying to offer a WYSIWYG HTML editor to my users, from inside my app. It doesn't have to be a fancy WYSIWYG. I just need basic functionality like Bold, Italic, Underline, images, link and some basic formatting (font size, colour, alignment). That should be enough. The perfect solution would be an open source library, but I haven't been able to find one. So I googled around for a web-based editor that works on Android. I found Sceditor . This editor works great when I fire up my Android browser (Chrome beta). It SEEMS to work from my webview (see screenshot) as well, but it doesn't.

Magento - add WYSIWYG editor to custom widget

≡放荡痞女 提交于 2019-11-30 14:05:57
I created a widget inside my custom module. Everything is working and the widget can be embedded onto CMS pages. However, instead of a textarea parameter type I want to add a WYSIWYG editor. This is the significant part in my widget.xml: <parameters> <description translate="label"> <required>0</required> <visible>1</visible> <label>Description</label> <type>textarea</type> </description> </parameters> I wonder if there's a way to extend Magento's functionality to allow a WYSIWYG editor similar to this: <parameters> <description translate="label"> <required>0</required> <visible>1</visible>