PDA

View Full Version : Ampersand in Replacement Text


cellarius
02-19-2008, 07:53 AM
Hi Morgan,

me again :o

I need ampersands replaced in my GALs (as in B&B or Bed & Breakfast). With version 4 this was possible (iirc). I tried escaping (\&), HTML-entities (&) and Unicode (&), but nothing works. In fact, the "&" is always stripped out when saving (so B&B -> Bamp;B and B&B -> B#38B).

Any idea how phrases with an "&" can be autolinked?

Morgan
02-21-2008, 10:22 PM
Word characters (\w), space (\s), comma (,), apostrophe ('), and dash (-) are currently allowed. Other characters get stripped, but if you want to allow other characters, you'd need to edit the strip_text function, appearing in both the gal_class_core.php and gal_class_dictionary.php files. Look for all instances of [^\w\s,\'\-] and add whatever you want to the character class, making sure to not allow unsafe characters. [^\w\s,&;\'\-] might do with either B&B or B&B but it'd need a test.

cellarius
02-29-2008, 10:15 AM
Works fine, though in the gals & have to be masked as html-entity. Also added the "." in order to be able to autolink things like thevbgeek.de.