XOOPS  2.6.0
formdhtmltextarea_preview.php
Go to the documentation of this file.
1 <?php
21 include_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'mainfile.php';
22 
24 $xoops->disableErrorReporting();
26 
27 $content = $myts->stripSlashesGPC($_POST['text']);
28 
29 if (!$xoops->security()->validateToken(@$_POST['token'], false)) {
30  $content = 'Direct access is not allowed!!!';
31 }
32 $html = empty($_POST['html']) ? 0 : 1;
33 $content = $myts->displayTarea($content, $html, 1, 1, 1, 1);
34 if (preg_match_all('/%u([[:alnum:]]{4})/', $content, $matches)) {
35  foreach ($matches[1] as $uniord) {
36  $utf = '&#x' . $uniord . ';';
37  $content = str_replace('%u' . $uniord, $utf, $content);
38  }
39  $content = urldecode($content);
40 }
41 
42 if (! headers_sent()) {
43  header('Content-Type:text/html; charset=ISO-8859-1');
44  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
45  header('Cache-Control: private, no-cache');
46  header('Pragma: no-cache');
47 }
48 echo "<div>" . $content . "</div>";
static getInstance()
Definition: Xoops.php:160
if(!$xoops->security() ->validateToken(@$_POST['token'], false)) $html
defined('DS') or define('DS' DIRECTORY_SEPARATOR
Definition: common.php:41