Exemple #1
0
function sc_prepare_contents(&$contents, $doEncode)
{
    $len = sizeof($contents);
    for ($i = 0; $i < $len; $i++) {
        list($name, $idstr, $time, $content) = unserialize($contents[$i]);
        $name = sc_dat_decode($name);
        $content = sc_dat_decode($content);
        if ($doEncode) {
            $name = sc_out($name, true);
            $content = sc_out($content, true);
        }
        $contents[$i] = array($name, $idstr, $time, $content);
    }
}
Exemple #2
0
 public function testScDatDecode()
 {
     $a = 'hello &lt;b&gt;world&lt;/b&gt;';
     $this->assertEquals('hello <b>world</b>', sc_dat_decode($a));
 }