I have noticed that when amperstands ("&") are present in a profile field, these get transformed to a & by profile tokens. E.g. I have a profile field called company name. There are some companies that have an amperstand in their names, like "Miller & Co." - Using profile tokens, the returned token value is "Miller & Co." which can be a bit problematic.

This is caused in line 117 of profile_token.module by the check_plain function. Interestingly enough, there is even some debate over this in the Drupal API manual for check_plain.

My workaround was to use check_markup instead of check_plain which preserves the & and other special characters very well. here my line 117 of profile_token.module:

      return check_markup($field->value);

Would this be an option to generally do a check_markup instead of a check_plain?!

Kind regards, Steve.

Comments

gateone’s picture

Sorry, the amperstand HTML entity of course gets rendered into a normal & in my post above. So & gets &