5tarl0rd
Current Path : /home/tiporg/www/inc/ |
|
Current File : /home/tiporg/www/inc/functions.php |
<?php
function clean_codes($slug)
{
$str = mysql_real_escape_string($slug);
$str = strip_tags($str);
$str = str_replace("%","-",$str);
$str = str_replace(":","-",$str);
$str = str_replace("?","-",$str);
$str = str_replace(":","-",$str);
$str = str_replace("'","-",$str);
$str = str_replace('"',"-",$str);
$str = str_replace('=',"-",$str);
$str = str_replace('1=1',"-",$str);
$str = str_replace('--',"-",$str);
$str = str_replace('UNION',"-",$str);
$str = str_replace('union',"-",$str);
return $str;
}
function mctencode($string,$key) {
$key = sha1($key);
$strLen = strlen($string);
$keyLen = strlen($key);
$j = 0;
$hash = "";
for ($i = 0; $i < $strLen; $i++) {
$ordStr = ord(substr($string,$i,1));
if($j == $keyLen) { $j = 0; }
$ordKey = ord(substr($key,$j,1));
$j++;
$hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36));
}
return $hash;
}
function mctdecode($string,$key) {
$key = sha1($key);
$strLen = strlen($string);
$keyLen = strlen($key);
$j = 0;
$hash = "";
for ($i = 0; $i < $strLen; $i+=2) {
$ordStr = hexdec(base_convert(strrev(substr($string,$i,2)),36,16));
if ($j == $keyLen) { $j = 0; }
$ordKey = ord(substr($key,$j,1));
$j++;
$hash .= chr($ordStr - $ordKey);
}
return $hash;
}
?>
5tarL0rd By