test magnet

<php>

function hide_magnet($mtext,$magnet){ $character_set = '%&+-.0123456789=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; $key = str_shuffle($character_set); $cipher_magnet = ; $cipher_text = ; $id = 'e'.rand(1,999999999); for ($i=0;$i<strlen($magnet);$i+=1) $cipher_magnet.= $key[strpos($character_set,$magnet[$i])]; $script = 'var a="'.$key.'";var b=a.split("").sort().join("");var c="'.$cipher_magnet.'";var d="";'; $script.= 'var t="'.$mtext.'";'; $script.= 'for(var e=0;e<c.length;e++)d+=b.charAt(a.indexOf(c.charAt(e)));'; $script.= 'document.getElementById("'.$id.'").innerHTML="<a href=\\"magnet:?xt=urn:btih:"+d+"\\"><img src=\"http://kb.feser.ru/lib/exe/fetch.php/magnet.png\" border=0>"+t+"</a>"'; $script = "eval(\"".str_replace(array("\\",'"'),array("\\\\",'\"'), $script)."\")"; $script = '<script type="text/javascript">/*<![CDATA[*/'.$script.'/*]]>*/</script>'; return '<span id="'.$id.'">[javascript protected magnet link]</span>'.$script; } </php>

<php> echo hide_magnet('Федора 21','89f0835dc2def218ec4bac73da6be6b8c20534ea'); </php>