Friendly URL's custom language patch

Description

Hi Geoff, hi Mat,

in the mail attachment I send you a zipped SVN-patch file for FarCry 6.0 !

I've programmed a language depending replacement for FUs in a new CFC 'farFU_Replace.cfc'.

To use it I had to change the code in the existing 'farFU.cfc' !

Please check my code and (if it's ok for you) feel free to use it for FarCry 6.0 !

Environment

None

Activity

Show:
Justin Carter
October 21, 2015 at 4:34 AM

No code sample attached. farFU has probably changed considerably since this ticket was opened – we can definitely revisit but we'll need some new guidance against a more current version of Core.

Matthew Bryant
January 19, 2010 at 10:01 PM

Mat, I think that wouldn't make sense, because your cleaning mess with the german. It would first replace the special german chars (ä,ü,ö,ß) with a "-" !

But that was the reason why I coded the custom language stuff !!!

Maybe there is a possibility to check just the "page title" string (NOT the entire FU string) with a regex for non legal chars (or just slashes "/") BEFORE every other check ?

I think the "page title" string has always to be a clean string without any unwanted chars before it is used for building the FU, because you never know what kind of chars the FC-User will use for a page title. A lot of unwanted chars in the FU I already do replace in my code: <cfset result = reReplaceNoCase(result,"

+",'',"all")>

Matthew Bryant
January 19, 2010 at 6:50 PM

does it work for you if we move the replaceCountrySpecificChars() to under where we do our initial cleaning, or does our cleaning mess with the german?

Matthew Bryant
January 19, 2010 at 6:50 PM

Sorry, now a few minutes later I see the need NOT to replace the slashes "/" !!!

Maybe it's an idea to generally clean up just the "page title" string from special chars BEFORE cleaning the whole FU !?

Matthew Bryant
January 19, 2010 at 6:49 PM

Hi Mat,

thanks you. The patch for "farFU.cfc" works correctly now for the special german chars !

But I explored a little error in my code in line 284 !

I did forget to place a "+" in that code !

I think it should be better: <cfset result = reReplaceNoCase(result,"

+",'',"all")>

I have testet a page with the following page titel: "PÖRKÖLT / Ungar. Gulasch".

This resolves in a FU with an unwanted slash: "/poerkoelt-/-ungar-gulasch

I think that the slash in the middle should be better replaced with a "-" ?!

Although you use in the original code (in line 238): <cfset cleanFU = ReReplaceNoCase(cleanFU,"

+","-","all")>

The slash in my title is not converted to a "-" in the FU !? - But I can't guess why.

Won't Fix

Details

Assignee

Reporter

Affects versions

Priority

Created January 18, 2010 at 10:59 PM
Updated October 21, 2015 at 4:34 AM
Resolved October 21, 2015 at 4:34 AM