Categories > TinyButStrong general >

Constants with tbs fields, MergeField and "["

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Jaime
Date: 2005-04-20
Time: 23:38

Constants with tbs fields, MergeField and "["

Hello

I am trying to merge constants that have tbs var fields defined inside.
Something like this:
define('GENERAL_ERROR','<strong>Error</strong>: [var.email] is not a valid email address');
Then, I merge constants with your MergeField and user function method:
$TBS->MergeField('cst','f_found_cst',true);
function f_found_cst($str) {
    return constant($str);
}

The problem is that all "[" characters are converted to &#91; and the variables inside constants are not merged.
I have checked the value of each constant in function f_found_cst  and the "[" are not changed there. I have also checked the values with onformat, and everything seems to be alright there. So, do you know what is happening and, what is more important, what should I do to solve this problem?

Thanks

Jaime
By: Skrol29
Date: 2005-04-20
Time: 23:53

Re: Constants with tbs fields, MergeField and "["

Hi Jaime,

That's the TBS protection system.
All data coming outside the template is protected from containing TBS tags. It's done by replacing '[ with '&#91' which is its Html equivalent.
Of course you can disabled the protection. You can disabled the protection for a specific field using parameter 'protect'.

  [cst.GENERAL_ERROR;htmlconv=no;protect=no]