<?php

/* Nulled by Wizzywig */
/***********تعريب***********/
/**          saher        **/
/**  منتديات شباب وصبايا  **/
/**   www.shababtop.com   **/
/**  saher1986@live.com   **/
/***************************/

// Formats line breaks and removes HTML in text
function sanitize($text) {
	global $disable_smilies;
	global $smileys;
	global $theme;
	global $base_url;
	
	$text = htmlspecialchars($text, ENT_NOQUOTES);
	$text = str_replace("\n\r","\n",$text);
	$text = str_replace("\r\n","\n",$text);
	$text = str_replace("\n"," <br> ",$text);
	
	if ($disable_smilies != 1) { 
		if (!empty($smileys)) {
			foreach ($smileys as $pattern => $result) {
				$text = str_replace($pattern,'<img class="arrowchat_smiley" height="16" width="16" src="'.$base_url.'themes/'.$theme.'/images/smilies/'.$result.'.gif" alt="'.$pattern.'">',$text);
			}
		}
	}

	return $text;
}

?>