punbb/include/parser.php
changeset 10 98d80b672f3c
parent 7 98bbc533541c
equal deleted inserted replaced
9:a932ce8c4827 10:98d80b672f3c
   446 	global $pun_config, $lang_common, $pun_user;
   446 	global $pun_config, $lang_common, $pun_user;
   447 
   447 
   448 	if ($pun_config['o_censoring'] == '1')
   448 	if ($pun_config['o_censoring'] == '1')
   449 		$text = censor_words($text);
   449 		$text = censor_words($text);
   450 
   450 
   451 	$text = htmlspecialchars($text);
       
   452 
       
   453 	if ($pun_config['o_make_links'] == '1')
   451 	if ($pun_config['o_make_links'] == '1')
   454 		$text = do_clickable($text);
   452 		$text = do_clickable($text);
   455 
   453 
   456 	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0')
   454 	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0')
   457 		$text = do_smilies($text);
   455 		$text = do_smilies($text);
   464 		{
   462 		{
   465 //			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text);
   463 //			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text);
   466 			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);
   464 			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);
   467 		}
   465 		}
   468 	}
   466 	}
   469 
   467   
   470 	// Deal with newlines, tabs and multiple spaces
   468   // Enano-specific!
   471 	$pattern = array("\n", "\t", '  ', '  ');
   469   return RenderMan::render($text);
   472 	$replace = array('<br />', '&nbsp; &nbsp; ', '&nbsp; ', ' &nbsp;');
   470 }
   473 	$text = str_replace($pattern, $replace, $text);
       
   474 
       
   475 	return $text;
       
   476 }