PDA

View Full Version : How to use & in keywords


fxrescbe
08-24-2009, 08:18 PM
I want to link a text that contains an &

When I enter it in the field, it gets stripped away.

Any ideas?

Morgan
09-10-2009, 06:02 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 word1&word2 or word1&word2 as the keyword, but it'd need a test.

JustaQuestion
10-05-2009, 10:59 PM
I tried both, word1&word2 and word1&word2, after changing the two instances of [^\w\s,\'\-] into [^\w\s,&;\'\-] in both .php files, but it doesn't seem to work. I even tried to rebuild the post cache, just in case, but no luck. Anything else we could try?

Morgan
10-07-2009, 03:42 PM
Not sure, others were able to get this to work so the only thing I can suggest is to try again. IIRC people needed to use word1&word2 as the keyword because vB amps the &s unless HTML is allowed in posts, which it shouldn't be due to security reasons.

JustaQuestion
10-09-2009, 12:53 PM
Hmm, I finally got it going by specifying as a keyword both of the following: Word1 & Word2,Word1 & Word2 (with just one or the other I had no luck).

Thanks for telling me to try again!