XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
formdhtmltextarea_preview.php
Go to the documentation of this file.
1 <?php
20 include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'mainfile.php';
21 
22 $xoopsLogger->activated = false;
24 
25 $content = $myts->stripSlashesGPC($_POST['text']);
26 
27 if (!$GLOBALS['xoopsSecurity']->validateToken(@$_POST['token'], false)) {
28  $content = 'Direct access is not allowed!!!';
29 }
30 $html = empty($_POST['html']) ? 0 : 1;
31 $content = $myts->displayTarea($content, $html, 1, 1, 1, 1);
32 if (preg_match_all('/%u([[:alnum:]]{4})/', $content, $matches)) {
33  foreach ($matches[1] as $uniord) {
34  $utf = '&#x' . $uniord . ';';
35  $content = str_replace('%u' . $uniord, $utf, $content);
36  }
37  $content = urldecode($content);
38 }
39 
40 if (! headers_sent()) {
41  $charset = (defined('_CHARSET') ? _CHARSET : 'UTF-8');
42  header('Content-Type:text/html; charset='.$charset);
43  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
44  header('Cache-Control: private, no-cache');
45  header('Pragma: no-cache');
46 }
47 echo "<div>" . $content . "</div>";
48 ?>