I also asked the same question over at the Adobe ColdFusion forums:
I just recently upgraded to ColdFusion 11 from ColdFusion 10 and noticed that quotation marks are not being escaped in ColdFusion 11 when those are entered in a textbox.
Here is an image from my ColdFusion 10 server where the quotation marks are automatically being escaped.
Here's the view source from Google Chrome:
Here is an image from my ColdFusion 11 server where the quotation marks are NOT being escaped.
Here's the view source from Google Chrome:
Does anyone know if this expected behavior or a bug? Do we really have to use EncodeForHTML() on every form field value now?
Update:
This is what the form field code looks like:
<cfinput type="text" name="NAME_HERE"
value="#VARIABLE_HERE#"
size="60" maxlength="1250">
Related
I am new into Google Data Studio and I am trying to cleanse some Google Analytic data.
For example I have a filed called page which shows the page name. For some pages I have duplicates e.g: contact/product/car and contact/product/car/ (ending in this case with /)
I want to create a field that always replace the last charterer of the page name if it ends with '/' with a space
I have tried this function: REPLACE(ENDS_WITH(Page,"/"), '/','')
But is not working instead giving me true or false.
Someone can help me with this?
Please use regular expression for doing this job:
REGEXP_REPLACE(Page,"/$","")
I have textarea field where user copy/paste the text from word document. When user tried to save the form this error message was returned fromt he server:
Error converting characters into server's character set. Some character(s) could not be converted.
After looking carefully over the text that user entered in the field I found out which character is causing the issue. So when user copy/paste the text from the word document dash character is different/longer than standard dash. So the text looks like this:
Red – All devices muted/Do not disturb is enabled
I simply replaced the dash and text looked like this:
Red - All devices muted/Do not disturb is enabled
and I was able to save the form. I'm wondering what I can do to correct/prevent this kind of issues? I use ColdFusion 2018 on the back end in combination with Sybase database. If anyone have suggestions on how to fix this error please let me know.
This is the string which i passing for
ZEND_JSON {"0":"265","product":"265","1":"059 Königsblau","st_color":"059 Königsblau","2":"","st_material":"","3":"XL","st_size":"XL","4":"287","stockmanagementid":"287"}
I want 059 Königsblau instead of 059 Königsblau this string.
This is the actual code in this files modules/Vtiger/PopupContents.tpl
Here is Code
data-info='{Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($LISTVIEW_ENTRY->getRawData()))}'
I feel the header content type issue.This url will help you for resolved the issue
How to display special characters in PHP
Hi I really like the new Ckeditor 4 Advanced Content Filtering along with the pastefromword plugin - and have read the docs on what html tags to allow and not, and I understand why it kindly converts my client's MS Word crap into htmlentities. However, I'd like to do a little intervention and convert the smart quotes to straight quotes - and all em dashes to plain dashes and not allow - before the text gets sent to the CMS database. But I can't find any docs on this or examples.
I can see there were many questions about this on the old forum Ckeditor forum http://ckeditor.com/forums/CKEditor-3.x/Replacing-smart-quotes-regular-quotes, http://ckeditor.com/forums/CKEditor-3.x/Problem-copyingpasting-MS-Word but they didn't get answered.
I'm also hoping the ckeditor team reads these forums as this is where they suggest we post questions now.
CKEditor dev here.
If you want the Paste From Word plugin to do this, you could add a rule in the plugin that replaces the contents of text nodes.
To achieve this add a property named 'text' somewhere over here(on the same level as the 'comment' property):
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/pastefromword/filter/default.js#L1106
It should be a function that accepts one parameter - the text node content, e.g.:
text: function( content ) {
return content.replace(/[\u201E\u201C]/g,'"'); // Unicode for „ and “
}
This way whenever the PFW plugin filter encounters a text node it'll replace its contents with whatever is returned by the above mentioned function.
Caveats: there are quite a few Unicode symbols that represent quotation marks and dashes.
By the way: you may not want to get too attached to the current Paste From Word plugin - we're planning a major refactor of it for v4.6.
I hope this was helpful.
I'm looking to restore an old site of mine from the internet archives, which thankfully is pretty intact.
The only thing is that extra comments have been added to the existing HTML, which I want to remove. The comments have been added to the bottom of every page and is as follows,
<!--
FILE ARCHIVED ON 15:22:46 Jan 15, 2011 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 11:36:37 Jul 11, 2014.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->
I've read over here that what I'm trying to do can be accomplished using regular expressions, but since I'm new to it I'd like some help.
This is all I've got after struggling for over 3 hours,
<!--(\s)*FILE ARCHIVED
I have got no clue on how to end it.
Any help would be gladly appreciated.
Match and replace the following regex with empty strings:
/<!--.+?-->/s
View a live regex demo.
Regular expression visualization:
The below regex would match only the comment section. Then you could remove the matched section easily.
/<!--\s*FILE ARCHIVED(?:[^\n]*[\n][^\n]*)*?-->/m
DEMO
OR
With the s(DOTALL) modifier,
/<!--\s*FILE ARCHIVED(?:(?!-->).)*-->/sg
DEMO
The Internet Archive allows us to retrieve the raw version of web pages. For example, if you have this URL (https://web.archive.org/web/20170204063743/http://john.smith#example.org/), replace the timestamp 20170204063743 with 20170204063743id_ (so the modified URL will look like https://web.archive.org/web/20170204063743id_/http://john.smith#example.org/) then you will get the original HTML without any additional comments added by the Internet Archive.
Please try this one:
preg_replace("/<!--(.|\s)*?-->/", "", $input_lines);
demo link
It will only keep the text "HTML content goes here" with the content below:
HTML content goes here
<!--
FILE ARCHIVED ON 15:22:46 Jan 15, 2011 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 11:36:37 Jul 11, 2014.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->
I'd go with something like this :
<!--(\s)*FILE ARCHIVED(\s|.)*-->
View a live demo