Custom tokens won't get replaced when used in greetings. Neither those with custom keys/categories nor those added to "contact" key.
keyname.tokenname shaped toekns won't get to replaceHookTokens() because only contact key is handled. And contact key's custom token's get escaped before replaceHookTokens() is called.
Line 1464 ff. say
As from what I know about the tokens array structure this seems to result in faulty array handling. And for god's sake custom token's shouldn't be bound to »contact« category. So changing the first three lines of the above to
allows handling of custom tokens in custom categories and fixes errors reported in http://civicrm.stackexchange.com/questions/2004/error-for-token-php-related-to-greeting-tokens?rq=1 Civi's SE.
Could someone review and comment on this plz.
Thanks for this cool peace of software!