Categories > TinyButStrong general >

print semicolon

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: mezcal
Date: 2011-06-14
Time: 14:20

print semicolon

Hello,

I have using TBS for 3 weeks.  I like it. but I have found a problem.

I print table from mysql database.
<tr class="tab_rl">
        <td>[blk_usr.lastname;block=tr]</td>
        <td align="center">[blk_usr.firstname]</td>
        <td align="center">[blk_usr.code]</td>
        <td align="center">[blk_usr.specialisation]</td>
        <td>[blk_usr.work]</td>
        <td>[blk_usr.email]</td>
</tr>


In database there is stored semicolons and single quotes.

Print semicolons or single quotes kills TBS.


I have figured out how to solved quotes:

$TBS->LoadTemplate(TEMPLATE_PATH.'page.html','UTF-8');

OR

$TBS->LoadTemplate(TEMPLATE_PATH.'page.html';

template file:
add htmlconv=esc




but the only solution of the semicolons I have found out is hacking tbs_class.php . line: 2459

function meth_Conv_Str(&$Txt,$ConvBr=true) {
    if ($this->Charset==='') { // Html by default
        $Txt = htmlspecialchars($Txt);
        $Txt = str_replace(";",",",$Txt); //hack replacing ; by ,
       
        if ($ConvBr) $Txt = nl2br($Txt);
    } elseif ($this->_CharsetFct) {
        $Txt = call_user_func($this->Charset,$Txt,$ConvBr);
    } else {
        $Txt = htmlspecialchars($Txt,ENT_COMPAT,$this->Charset);
       
        $Txt = str_replace(";",",",$Txt); //hack replacing ; by ,
       
        if ($ConvBr) $Txt = nl2br($Txt);
    }
}




Does exist any cleaner way how to solve it.

Thank you
By: Skrol29
Date: 2011-06-15
Time: 00:19

Re: print semicolon

Hi,

> Print semicolons or single quotes kills TBS.

What do you mean ?
Can you give an example ?