1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19:
20:
21: 22: 23: 24: 25: 26:
27: class MyTextSanitizerExtension
28: {
29: public $instance;
30: public $ts;
31: public $config;
32: public $image_path;
33:
34: 35: 36: 37: 38:
39: public function __construct(MyTextSanitizer $ts)
40: {
41: $this->ts = $ts;
42: $this->image_path = XOOPS_URL . '/images/form';
43: }
44:
45: 46: 47: 48: 49: 50:
51: public static function loadConfig($path = null)
52: {
53: $ts = MyTextSanitizer::getInstance();
54: $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
55: if (false === strpos($path, '/')) {
56: if (is_dir($ts->path_basic . '/' . $path)) {
57: $path = $ts->path_basic . '/' . $path;
58: } else {
59: if (is_dir($ts->path_plugin . '/' . $path)) {
60: $path = $ts->path_plugin . '/' . $path;
61: }
62: }
63: }
64: $config_default = array();
65: $config_custom = array();
66: if (file_exists($path . '/config.php')) {
67: $config_default = include $path . '/config.php';
68: }
69: if (file_exists($path . '/config.custom.php')) {
70: $config_custom = include $path . '/config.custom.php';
71: }
72:
73: return self::mergeConfig($config_default, $config_custom);
74: }
75:
76: 77: 78: 79: 80: 81: 82:
83: public static function mergeConfig($config_default, $config_custom)
84: {
85: if (is_array($config_custom)) {
86: foreach ($config_custom as $key => $val) {
87: if (is_array($config_default[$key])) {
88: $config_default[$key] = self::mergeConfig($config_default[$key], $config_custom[$key]);
89: } else {
90: $config_default[$key] = $val;
91: }
92: }
93: }
94:
95: return $config_default;
96: }
97:
98: 99: 100: 101: 102: 103: 104:
105: public function encode($textarea_id)
106: {
107: return array();
108: }
109:
110: 111: 112: 113: 114:
115: public static function decode($url, $width, $height)
116: {
117: return null;
118: }
119: }
120:
121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132:
133: class MyTextSanitizer
134: {
135: 136: 137: 138:
139: public $smileys = array();
140:
141: 142:
143: public $censorConf;
144:
145: 146: 147: 148:
149: public $text = '';
150: public $patterns = array();
151: public $replacements = array();
152:
153:
154: public $callbackPatterns = array();
155: public $callbacks = array();
156:
157:
158: public $path_basic;
159: public $path_plugin;
160:
161: public $config;
162:
163: 164: 165: 166: 167: 168: 169: 170: 171:
172:
173: public function __construct()
174: {
175: $this->path_basic = XOOPS_ROOT_PATH . '/class/textsanitizer';
176: $this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/textsanitizer';
177: $this->config = $this->loadConfig();
178: }
179:
180: 181: 182: 183: 184: 185:
186: public function loadConfig($name = null)
187: {
188: if (!empty($name)) {
189: return MyTextSanitizerExtension::loadConfig($name);
190: }
191: $config_default = include $this->path_basic . '/config.php';
192: $config_custom = array();
193: if (file_exists($file = $this->path_basic . '/config.custom.php')) {
194: $config_custom = include $file;
195: }
196:
197: return $this->mergeConfig($config_default, $config_custom);
198: }
199:
200: 201: 202: 203: 204: 205: 206:
207: public function mergeConfig($config_default, $config_custom)
208: {
209: if (is_array($config_custom)) {
210: foreach ($config_custom as $key => $val) {
211: if (isset($config_default[$key]) && is_array($config_default[$key])) {
212: $config_default[$key] = $this->mergeConfig($config_default[$key], $config_custom[$key]);
213: } else {
214: $config_default[$key] = $val;
215: }
216: }
217: }
218:
219: return $config_default;
220: }
221:
222: 223: 224: 225: 226: 227: 228:
229: public static function getInstance()
230: {
231: static $instance;
232: if (!isset($instance)) {
233: $instance = new MyTextSanitizer();
234: }
235:
236: return $instance;
237: }
238:
239: 240: 241: 242: 243: 244: 245:
246: public function getSmileys($isAll = true)
247: {
248: if (count($this->smileys) == 0) {
249:
250: $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
251: if ($getsmiles = $xoopsDB->query('SELECT * FROM ' . $xoopsDB->prefix('smiles'))) {
252: while ($smiles = $xoopsDB->fetchArray($getsmiles)) {
253: $this->smileys[] = $smiles;
254: }
255: }
256: }
257: if ($isAll) {
258: return $this->smileys;
259: }
260:
261: $smileys = array();
262: foreach ($this->smileys as $smile) {
263: if (empty($smile['display'])) {
264: continue;
265: }
266: $smileys[] = $smile;
267: }
268:
269: return $smileys;
270: }
271:
272: 273: 274: 275: 276: 277:
278: public function smiley($message)
279: {
280: $smileys = $this->getSmileys();
281: foreach ($smileys as $smile) {
282: $message = str_replace($smile['code'], '<img class="imgsmile" src="' . XOOPS_UPLOAD_URL . '/' . htmlspecialchars($smile['smile_url']) . '" alt="" />', $message);
283: }
284:
285: return $message;
286: }
287:
288: 289: 290: 291: 292:
293: public function makeClickableCallback01($match)
294: {
295: return $match[1] . "<a href=\"$match[2]://$match[3]\" title=\"$match[2]://$match[3]\" rel=\"external\">$match[2]://" . $this->truncate($match[3]) . '</a>';
296: }
297:
298: 299: 300: 301: 302:
303: public function makeClickableCallback02($match)
304: {
305: return $match[1] . "<a href=\"http://www.$match[2]$match[6]\" title=\"www.$match[2]$match[6]\" rel=\"external\">" . $this->truncate('www.' . $match[2] . $match[6]) . '</a>';
306: }
307:
308: 309: 310: 311: 312:
313: public function makeClickableCallback03($match)
314: {
315: return $match[1] . "<a href=\"ftp://ftp.$match[2].$match[3]\" title=\"ftp.$match[2].$match[3]\" rel=\"external\">" . $this->truncate('ftp.' . $match[2] . $match[3]) . '</a>';
316: }
317:
318: 319: 320: 321: 322:
323: public function makeClickableCallback04($match)
324: {
325: return $match[1] . "<a href=\"mailto:$match[2]@$match[3]\" title=\"$match[2]@$match[3]\">" . $this->truncate($match[2] . '@' . $match[3]) . '</a>';
326: }
327:
328: 329: 330: 331: 332: 333:
334: public function makeClickable(&$text)
335: {
336: $text1 = $text;
337:
338: $valid_chars = "a-z0-9\/\-_+=.~!%@?#&;:$\|";
339: $end_chars = "a-z0-9\/\-_+=~!%@?#&;:$\|";
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361: $pattern = "/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([{$valid_chars}]+[{$end_chars}])/i";
362: $text1 = preg_replace_callback($pattern, 'self::makeClickableCallback01', $text1);
363:
364: $pattern = "/(^|[^]_a-z0-9-=\"'\/:\.])www\.((([a-zA-Z0-9\-]*\.){1,}){1}([a-zA-Z]{2,6}){1})((\/([a-zA-Z0-9\-\._\?\,\'\/\\+&%\$#\=~])*)*)/i";
365: $text1 = preg_replace_callback($pattern, 'self::makeClickableCallback02', $text1);
366:
367: $pattern = "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([{$valid_chars}]+[{$end_chars}])/i";
368: $text1 = preg_replace_callback($pattern, 'self::makeClickableCallback03', $text1);
369:
370: $pattern = "/(^|[^]_a-z0-9-=\"'\/:\.])([-_a-z0-9\'+*$^&%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*+)@((?:(?![-.])[-a-z0-9.]+(?<![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?)/i";
371: $text1 = preg_replace_callback($pattern, 'self::makeClickableCallback04', $text1);
372:
373: return $text1;
374: }
375:
376: 377: 378: 379: 380: 381:
382: public function truncate($text)
383: {
384: $instance = MyTextSanitizer::getInstance();
385: if (empty($text) || empty($instance->config['truncate_length']) || strlen($text) < $instance->config['truncate_length']) {
386: return $text;
387: }
388: $len = floor($instance->config['truncate_length'] / 2);
389: $ret = substr($text, 0, $len) . ' ... ' . substr($text, 5 - $len);
390:
391: return $ret;
392: }
393:
394: 395: 396: 397: 398: 399: 400: 401:
402: public function &xoopsCodeDecode(&$text, $allowimage = 1)
403: {
404: $patterns = array();
405: $replacements = array();
406: $patterns[] = "/\[siteurl=(['\"]?)([^\"'<>]*)\\1](.*)\[\/siteurl\]/sU";
407: $replacements[] = '<a href="' . XOOPS_URL . '/\\2" title="">\\3</a>';
408: $patterns[] = "/\[url=(['\"]?)(http[s]?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
409: $replacements[] = '<a href="\\2" rel="external" title="">\\3</a>';
410: $patterns[] = "/\[url=(['\"]?)(ftp?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
411: $replacements[] = '<a href="\\2" rel="external" title="">\\3</a>';
412: $patterns[] = "/\[url=(['\"]?)([^'\"<>]*)\\1](.*)\[\/url\]/sU";
413: $replacements[] = '<a href="http://\\2" rel="external" title="">\\3</a>';
414: $patterns[] = "/\[color=(['\"]?)([a-zA-Z0-9]*)\\1](.*)\[\/color\]/sU";
415: $replacements[] = '<span style="color: #\\2;">\\3</span>';
416: $patterns[] = "/\[size=(['\"]?)([a-z0-9-]*)\\1](.*)\[\/size\]/sU";
417: $replacements[] = '<span style="font-size: \\2;">\\3</span>';
418: $patterns[] = "/\[font=(['\"]?)([^;<>\*\(\)\"']*)\\1](.*)\[\/font\]/sU";
419: $replacements[] = '<span style="font-family: \\2;">\\3</span>';
420: $patterns[] = "/\[email]([^;<>\*\(\)\"']*)\[\/email\]/sU";
421: $replacements[] = '<a href="mailto:\\1" title="">\\1</a>';
422:
423: $patterns[] = "/\[b](.*)\[\/b\]/sU";
424: $replacements[] = '<strong>\\1</strong>';
425: $patterns[] = "/\[i](.*)\[\/i\]/sU";
426: $replacements[] = '<em>\\1</em>';
427: $patterns[] = "/\[u](.*)\[\/u\]/sU";
428: $replacements[] = '<span style="text-decoration: underline;">\\1</span>';
429: $patterns[] = "/\[d](.*)\[\/d\]/sU";
430: $replacements[] = '<del>\\1</del>';
431: $patterns[] = "/\[center](.*)\[\/center\]/sU";
432: $replacements[] = '<div style="text-align: center;">\\1</div>';
433: $patterns[] = "/\[left](.*)\[\/left\]/sU";
434: $replacements[] = '<div style="text-align: left;">\\1</div>';
435: $patterns[] = "/\[right](.*)\[\/right\]/sU";
436: $replacements[] = '<div style="text-align: right;">\\1</div>';
437:
438: $this->text = $text;
439: $this->patterns = $patterns;
440: $this->replacements = $replacements;
441:
442: $this->config['allowimage'] = $allowimage;
443: $this->executeExtensions();
444:
445: $text = preg_replace($this->patterns, $this->replacements, $this->text);
446:
447: $count = count($this->callbackPatterns);
448:
449: for ($i = 0; $i < $count; ++$i) {
450: $text = preg_replace_callback($this->callbackPatterns[$i], $this->callbacks[$i], $text);
451: }
452:
453: $text = $this->quoteConv($text);
454:
455: return $text;
456: }
457:
458: 459: 460: 461: 462: 463:
464: public function quoteConv($text)
465: {
466:
467: $pattern = "/\[quote](.*)\[\/quote\]/sU";
468: $replacement = _QUOTEC . '<div class="xoopsQuote"><blockquote>\\1</blockquote></div>';
469:
470: $text = preg_replace($pattern, $replacement, $text, -1, $count);
471:
472: if (!$count) {
473: return $text;
474: }
475:
476:
477: return $this->quoteConv($text);
478: }
479:
480: 481: 482: 483: 484: 485: 486:
487: public function filterXss($text)
488: {
489: $patterns = array();
490: $replacements = array();
491: $text = str_replace("\x00", '', $text);
492: $c = "[\x01-\x1f]*";
493: $patterns[] = "/\bj{$c}a{$c}v{$c}a{$c}s{$c}c{$c}r{$c}i{$c}p{$c}t{$c}[\s]*:/si";
494: $replacements[] = 'javascript;';
495: $patterns[] = "/\ba{$c}b{$c}o{$c}u{$c}t{$c}[\s]*:/si";
496: $replacements[] = 'about;';
497: $patterns[] = "/\bx{$c}s{$c}s{$c}[\s]*:/si";
498: $replacements[] = 'xss;';
499: $text = preg_replace($patterns, $replacements, $text);
500:
501: return $text;
502: }
503:
504: 505: 506: 507: 508: 509:
510: public function nl2Br($text)
511: {
512: return preg_replace('/(\015\012)|(\015)|(\012)/', '<br>', $text);
513: }
514:
515: 516: 517: 518: 519: 520:
521: public function addSlashes($text)
522: {
523: if (!get_magic_quotes_gpc()) {
524: $text = addslashes($text);
525: }
526:
527: return $text;
528: }
529:
530: 531: 532: 533: 534: 535:
536: public function stripSlashesGPC($text)
537: {
538: if (get_magic_quotes_gpc()) {
539: $text = stripslashes($text);
540: }
541:
542: return $text;
543: }
544:
545: 546: 547: 548: 549: 550: 551: 552: 553:
554: public function htmlSpecialChars($text, $quote_style = ENT_QUOTES, $charset = null, $double_encode = true)
555: {
556: if (version_compare(phpversion(), '5.2.3', '>=')) {
557: $text = htmlspecialchars($text, $quote_style, $charset ?: (defined('_CHARSET') ? _CHARSET : 'UTF-8'), $double_encode);
558: } else {
559: $text = htmlspecialchars($text, $quote_style);
560: }
561:
562: return preg_replace(array('/&/i', '/ /i'), array('&', '&nbsp;'), $text);
563: }
564:
565: 566: 567: 568: 569: 570:
571: public function undoHtmlSpecialChars($text)
572: {
573: return preg_replace(array('/>/i', '/</i', '/"/i', '/'/i', '/&nbsp;/i'), array('>', '<', '"', '\'', ' '), $text);
574: }
575:
576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586:
587: public function &displayTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
588: {
589: $charset = (defined('_CHARSET') ? _CHARSET : 'UTF-8');
590: if (function_exists('mb_convert_encoding')) {
591: $text = mb_convert_encoding($text, $charset, mb_detect_encoding($text, mb_detect_order(), true));
592: }
593: if ($html != 1) {
594:
595: $text = $this->htmlSpecialChars($text, ENT_COMPAT, $charset);
596: }
597: $text = $this->codePreConv($text, $xcode);
598: if ($smiley != 0) {
599:
600: $text = $this->smiley($text);
601: }
602: if ($xcode != 0) {
603:
604: if ($image != 0) {
605:
606: $text =& $this->xoopsCodeDecode($text);
607: } else {
608:
609: $text =& $this->xoopsCodeDecode($text, 0);
610: }
611: }
612: if ($br != 0) {
613: $text = $this->nl2Br($text);
614: }
615: $text = $this->codeConv($text, $xcode);
616: $text = $this->makeClickable($text);
617: if (!empty($this->config['filterxss_on_display'])) {
618: $text = $this->filterXss($text);
619: }
620:
621: return $text;
622: }
623:
624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634:
635: public function &previewTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
636: {
637: $text = $this->stripSlashesGPC($text);
638: $text =& $this->displayTarea($text, $html, $smiley, $xcode, $image, $br);
639:
640: return $text;
641: }
642:
643: 644: 645: 646: 647: 648: 649:
650: public function &censorString(&$text)
651: {
652: $ret = $this->executeExtension('censor', $text);
653: if ($ret === false) {
654: return $text;
655: }
656:
657: return $ret;
658: }
659:
660: 661: 662: 663: 664: 665: 666:
667: public function codePreConv($text, $xcode = 1)
668: {
669: if ($xcode != 0) {
670:
671:
672:
673: $patterns = "/\[code([^\]]*?)\](.*)\[\/code\]/sU";
674: $text = preg_replace_callback(
675: $patterns,
676: function ($matches) {
677: return '[code'. $matches[1] . ']' . base64_encode($matches[2]) . '[/code]';
678: },
679: $text
680: );
681: }
682:
683: return $text;
684: }
685:
686: 687: 688: 689: 690:
691: public function codeConvCallback($match)
692: {
693: return '<div class="xoopsCode">' . $this->executeExtension('syntaxhighlight', str_replace('\\\"', '\"', base64_decode($match[2])), $match[1]) . '</div>';
694: }
695:
696: 697: 698: 699: 700: 701: 702:
703: public function codeConv($text, $xcode = 1)
704: {
705: if (empty($xcode)) {
706: return $text;
707: }
708: $patterns = "/\[code([^\]]*?)\](.*)\[\/code\]/sU";
709: $text1 = preg_replace_callback($patterns, array($this, 'codeConvCallback'), $text);
710:
711: return $text1;
712: }
713:
714: 715: 716: 717: 718:
719: public function executeExtensions()
720: {
721: $extensions = array_filter($this->config['extensions']);
722: if (empty($extensions)) {
723: return true;
724: }
725: foreach (array_keys($extensions) as $extension) {
726: $this->executeExtension($extension);
727: }
728: return null;
729: }
730:
731: 732: 733: 734: 735: 736:
737: public function loadExtension($name)
738: {
739: if (file_exists($file = $this->path_basic . '/' . $name . '/' . $name . '.php')) {
740: include_once $file;
741: } elseif (file_exists($file = $this->path_plugin . '/' . $name . '/' . $name . '.php')) {
742: include_once $file;
743: } else {
744: return false;
745: }
746: $class = 'Myts' . ucfirst($name);
747: if (!class_exists($class)) {
748: trigger_error("Extension '{$name}' does not exist", E_USER_WARNING);
749:
750: return false;
751: }
752: $extension = null;
753: $extension = new $class($this);
754:
755: return $extension;
756: }
757:
758: 759: 760: 761: 762: 763:
764: public function executeExtension($name)
765: {
766: $extension = $this->loadExtension($name);
767: $args = array_slice(func_get_args(), 1);
768: array_unshift($args, $this);
769:
770: return call_user_func_array(array($extension, 'load'), $args);
771: }
772:
773: 774: 775: 776: 777: 778: 779: 780:
781: public function textFilter($text, $force = false)
782: {
783: $ret = $this->executeExtension('textfilter', $text, $force);
784: if ($ret === false) {
785: return $text;
786: }
787:
788: return $ret;
789: }
790:
791:
792: 793: 794: 795: 796:
797:
798: 799: 800: 801: 802: 803: 804:
805: public function codeSanitizer($str, $image = 1)
806: {
807: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
808: $str = $this->htmlSpecialChars(str_replace('\"', '"', base64_decode($str)));
809: $str =& $this->xoopsCodeDecode($str, $image);
810:
811: return $str;
812: }
813:
814: 815: 816: 817: 818: 819: 820: 821: 822:
823: public function sanitizeForDisplay($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
824: {
825: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
826: if ($allowhtml == 0) {
827: $text = $this->htmlSpecialChars($text);
828: } else {
829:
830:
831:
832: $text = $this->makeClickable($text);
833: }
834: if ($smiley == 1) {
835: $text = $this->smiley($text);
836: }
837: if ($bbcode == 1) {
838: $text =& $this->xoopsCodeDecode($text);
839: }
840: $text = $this->nl2Br($text);
841:
842: return $text;
843: }
844:
845: 846: 847: 848: 849: 850: 851: 852: 853:
854: public function sanitizeForPreview($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
855: {
856: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
857: $text = $this->oopsStripSlashesGPC($text);
858: if ($allowhtml == 0) {
859: $text = $this->htmlSpecialChars($text);
860: } else {
861:
862:
863:
864: $text = $this->makeClickable($text);
865: }
866: if ($smiley == 1) {
867: $text = $this->smiley($text);
868: }
869: if ($bbcode == 1) {
870: $text =& $this->xoopsCodeDecode($text);
871: }
872: $text = $this->nl2Br($text);
873:
874: return $text;
875: }
876:
877: 878: 879: 880: 881: 882:
883: public function makeTboxData4Save($text)
884: {
885: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
886:
887:
888: return $this->addSlashes($text);
889: }
890:
891: 892: 893: 894: 895: 896: 897:
898: public function makeTboxData4Show($text, $smiley = 0)
899: {
900: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
901: $text = $this->htmlSpecialChars($text);
902:
903: return $text;
904: }
905:
906: 907: 908: 909: 910: 911:
912: public function makeTboxData4Edit($text)
913: {
914: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
915:
916: return $this->htmlSpecialChars($text);
917: }
918:
919: 920: 921: 922: 923: 924: 925:
926: public function makeTboxData4Preview($text, $smiley = 0)
927: {
928: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
929: $text = $this->stripSlashesGPC($text);
930: $text = $this->htmlSpecialChars($text);
931:
932: return $text;
933: }
934:
935: 936: 937: 938: 939: 940:
941: public function makeTboxData4PreviewInForm($text)
942: {
943: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
944: $text = $this->stripSlashesGPC($text);
945:
946: return $this->htmlSpecialChars($text);
947: }
948:
949: 950: 951: 952: 953: 954:
955: public function makeTareaData4Save($text)
956: {
957: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
958:
959: return $this->addSlashes($text);
960: }
961:
962: 963: 964: 965: 966: 967: 968: 969: 970:
971: public function &makeTareaData4Show(&$text, $html = 1, $smiley = 1, $xcode = 1)
972: {
973: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
974: $text =& $this->displayTarea($text, $html, $smiley, $xcode);
975:
976: return $text;
977: }
978:
979: 980: 981: 982: 983: 984:
985: public function makeTareaData4Edit($text)
986: {
987: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
988:
989: return $this->htmlSpecialChars($text);
990: }
991:
992: 993: 994: 995: 996: 997: 998: 999: 1000:
1001: public function &makeTareaData4Preview(&$text, $html = 1, $smiley = 1, $xcode = 1)
1002: {
1003: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1004: $text =& $this->previewTarea($text, $html, $smiley, $xcode);
1005:
1006: return $text;
1007: }
1008:
1009: 1010: 1011: 1012: 1013: 1014:
1015: public function makeTareaData4PreviewInForm($text)
1016: {
1017: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1018:
1019: $text = $this->stripSlashesGPC($text);
1020:
1021: return $this->htmlSpecialChars($text);
1022: }
1023:
1024: 1025: 1026: 1027: 1028: 1029:
1030: public function makeTareaData4InsideQuotes($text)
1031: {
1032: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1033:
1034: return $this->htmlSpecialChars($text);
1035: }
1036:
1037: 1038: 1039: 1040: 1041: 1042:
1043: public function oopsStripSlashesGPC($text)
1044: {
1045: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1046:
1047: return $this->stripSlashesGPC($text);
1048: }
1049:
1050: 1051: 1052: 1053: 1054: 1055:
1056: public function oopsStripSlashesRT($text)
1057: {
1058: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1059: if (get_magic_quotes_runtime()) {
1060: $text = stripslashes($text);
1061: }
1062:
1063: return $text;
1064: }
1065:
1066: 1067: 1068: 1069: 1070: 1071:
1072: public function oopsAddSlashes($text)
1073: {
1074: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1075:
1076: return $this->addSlashes($text);
1077: }
1078:
1079: 1080: 1081: 1082: 1083: 1084:
1085: public function oopsHtmlSpecialChars($text)
1086: {
1087: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1088:
1089: return $this->htmlSpecialChars($text);
1090: }
1091:
1092: 1093: 1094: 1095: 1096: 1097:
1098: public function oopsNl2Br($text)
1099: {
1100: $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
1101:
1102: return $this->nl2Br($text);
1103: }
1104: }
1105: