Making Text in an External Plugin HTML Tag Compatible

4 months 1 week ago - 4 months 1 week ago #336459 by 4creator
Hello,

I would like to share some code extracted from a CB plugin developed by an external developer.
use CBLib\Language\CBTxt;
// (Omitted)
    // get plugin params
    $plugin =  JPluginHelper::getPlugin('jevents', 'jevusers');
    if (!$plugin)
        return "";
    $jevusers_params = new JRegistry($plugin->params);

    if ($jevusers_params->get("showattending", 1))
    {
        $tab_intro = $this->params->get('tabMessage', "JEVENTS_TAB_TEXT_DEFAULT_2");
    }
    else
    {
        $tab_intro = $this->params->get('tabMessage', 'UPCOMING_EVENTS_CREATED_BY_THIS_USER_OR_THEY_AREATTENDING');
    }
    $tab_intro = CBTxt::T($tab_intro);

In the Tab management, I have set CB_JEVENS_NOTE as the tab text parameter for this plugin. I have also set up the text for CB_JEVENS_NOTE in the Plugin management's language override.
Currently, when I input <strong>my text</strong>, the <strong> tags are being output as text. I suspect that $tab_intro = CBTxt::T($tab_intro); is the cause of this. Is it possible to make this code compatible with HTML tags?


Thanks

Please Log in to join the conversation.

4 months 1 week ago #336464 by krileon
Your issue would be after that code. You've something applying htmlspecialchars to $tab_intro before display. CBTxt::T just translates it does not remove or convert HTML in any way.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: 4creator

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.194 seconds

Facebook Twitter LinkedIn