Jake Churchill

… on Flex, ColdFusion, FarCry, and much more …

  • Home
  • About
  • Projects

8

Feb

FCKEditor Firefox 3.6 Bug (Year 2010 Bug)

Posted by Jake Churchill  Published in Uncategorized

The new version of Firefox broke my FCKEditor! They didn't do it on purpose I'm sure, but it did, in fact, break it. I am using what I consider the standard implementation in ColdFusion (that does not come bundled with ColdFusion). I updated my Firefox to the most recent version (3.6) which was released on January 28 and BOOM! Goodbye WYSIWIG.

The implementation uses the standard CFC (fckeditor.cfc) which includes a function in a file called "fckutils.cfm". Line 47 of that function looks like this:

stResult = reFind( "gecko/(200[3-9][0-1][0-9][0-3][0-9])", sAgent, 1, true );

This new release was released in 2010 so the first part of the string after "gecko/" fails. Changing that line to this will fix the problem:

stResult = reFind( "gecko/(20[0-9][0-9][0-1][0-9][0-3][0-9])", sAgent, 1, true );

I can't really take the credit. I found the solution on Pete Freitag's blog. Here's his post: http://www.petefreitag.com/item/737.cfm

1 comment

3

Feb

ColdFusion using Java for regex replace

Posted by Jake Churchill  Published in Uncategorized

Yesterday, I found myself needing more than ColdFusion could supply. I had a variable with content that came from a WYSIWYG editor. Some of that content was the result of inserting images into the content. By default the image source was set to the absolute path from the webroot (i.e. /images/imagefile.jpg). This worked great for the web, but I needed the same content to be sent via email which did not work so well.

I needed to find all instances of the “src” attribute and tack on a domain so the ending result would be http://domain.com/images/imagefile.jpg and therefore would be email friendly. I tried several ways of doing this (combinations of REFind, REMatch, etc) but everything ended up being more difficult than it should have been.

Luckily, a ColdFusion String maps directly to a Java String so even though the docs might not suggest it, there are methods available for use. The one I wanted was “replaceAll()”. It does a simple regex replace and allows for backreferencing ($1, $2, etc). Backreferencing is key to not lose content that I needed (i.e. /images/imagefile.jpg). So, here’s the code that finally made my day:

<cfset domainName = "http://domain.com" />
<cfset contentVariable = contentVariable.replaceAll("src=\""(\/.+?)\""", "src=\""#domainName#$1\""") />

Full documentation on Java’s String functions can be seen at the Java Docs -> String

6 comments

Search

Blog Feed

  • Add blog to any reader
  • Comments Rss
May 2013
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  

 

May 2013
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Subscribe to Blog

Your email:

Subscribe   Unsubscribe

Archives

Categories

  • Browsers (3)
  • CFEclipse (2)
  • ColdFusion (7)
  • CSS (9)
  • Farcry (33)
    • Farcry Examples (2)
    • Farcry Users (1)
  • Flash (1)
  • Flex (14)
  • Javascript (5)
  • Life & Fun (3)
  • Microsoft Office (1)
  • Misc (4)
  • Random Posts (1)
  • SQL (2)
  • Uncategorized (2)

Blogroll

  • Axel Jensen
  • Ben Forta
  • Coldfusion Muse
  • Fullasagoog
  • Nicole Rutter
  • Ray Camden
  • Sandy Clark
  • Stillnet Studios

Recent Posts

  • FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • ColdFusion using Java for regex replace
  • ColdFusion VirtualMerchant CFC
  • Farcry Navigation Move Permissions
  • Delete Mail via POP Script

Recent Comments

  • James Moberg on FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • Jake Churchill on ColdFusion using Java for regex replace
  • Ben Nadel on ColdFusion using Java for regex replace
  • Peter Boughton on ColdFusion using Java for regex replace
  • Peter Boughton on ColdFusion using Java for regex replace

Recent Post

  • FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • ColdFusion using Java for regex replace
  • ColdFusion VirtualMerchant CFC
  • Farcry Navigation Move Permissions
  • Delete Mail via POP Script
  • Flex 2 Datagrid not highlighting row (UPDATE)
  • Flex 2 Datagrid not highlighting row
  • Flex Dynamic casting of data
  • Reboot XP PC over Remote Desktop
  • Dynamically instantiate a class

Recent Comments

  • James Moberg in FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • Jake Churchill in ColdFusion using Java for regex replace
  • Ben Nadel in ColdFusion using Java for regex replace
  • Peter Boughton in ColdFusion using Java for regex replace
  • Peter Boughton in ColdFusion using Java for regex replace
  • Matthew in ColdFusion using Java for regex replace
  • Matthew in ColdFusion using Java for regex replace
  • Jake Churchill in Flex Channel.Connect.Failed error NetConnection.Ca…
  • Flex Guy in Flex Channel.Connect.Failed error NetConnection.Ca…
  • Dexter in Flex Custom Preloader without SWF
© 2008 Jake Churchill is proudly powered by WordPress
Theme designed by Roam2Rome