вопрос
Всем привет, помогите убрать из ссылок кракозябры такого вида %3A%2F%2, нужно чтобы осталась чисто ссылка, вот пример что с кракозябябрами
<a href="/click?a%3Ahttp%3A%2F%2Fwww.ign.com%2Farticles%2F2013%2F07%2F30%2Fhalo-spartan-assault-review" target="_blank">Читать полностью на IGN</a>Вот еще php код, я так понял в нем что-то подредактировать нужно, т.к другие файлы отвечают за out страницу
<?php
/*
=====================================================
dude Smart Leech module
-----------------------------------------------------
http://seodude.ru/
=====================================================
*/
if(!defined('DATALIFEENGINE'))
{
die("Hacking attempt!");
}
define("DUDE_SMART_LEECH_START", microtime(true));
$_dude_config = array_filter((array)@unserialize(file_get_contents(dirname(__FILE__)."/../cfg/leech.dat")));
$groupID = $user_group[$member_id['user_group']]['id'];
// [[ stupid dle algoritms hack
$content = ob_get_clean();
ob_start();
if(!@$_dude_config['debug'])
{
$errlevel = error_reporting(0);
}
if($_dude_config['gopage'] && $_dude_config['gopage_url'])
{
define("DUDE_OUT_PAGE_URL", "/".ltrim($_dude_config['gopage_url'], "/"));
}
else
{
define("DUDE_OUT_PAGE_URL", "/engine/dude/index/leech_out.php");
}
preg_match_all('#\[forceleech\](.*?)\[/forceleech\]#ism',$content,$forceleech, PREG_SET_ORDER);
foreach($forceleech as $i=>$html)
{
$replace = preg_replace('#\[\s*/?\s*noleech\s*\]#ism','', $html[1]);
$content = str_replace($html[0], $replace, $content);
}
preg_match_all('#\[noleech\](.*?)\[/noleech\]#ism',$content,$noleech, PREG_SET_ORDER);
foreach($noleech as $i=>$html)
{
$uniqid = "*".uniqid("noleech_")."*";
$noleech[$i] = array($uniqid, $html[1]);
$content = str_replace($html[0], $uniqid, $content);
}
if($_dude_config['enable'] && in_array($groupID, (array)@$_dude_config['groups']) !== false)
{
$content = dude_smart_leech($content);
}
foreach($noleech as $nl)
{
$content = str_replace($nl[0], $nl[1], $content);
}
$content .= "<!-- dude Smart Leech time: ".sprintf("%f",(microtime(true) - DUDE_SMART_LEECH_START) * 1000)." msec -->";
echo $content;
if(!@$_dude_config['debug'])
{
error_reporting($errlevel);
}
// stupid dle algoritms hack ]]
function dude_smart_leech($content)
{
global $_dude_config;
$content = str_replace("{dude_leech}", "<a href=\"/\">dude Smart Leech</a>", $content);
$tags = array();
$links = array();
if($_dude_config['rewrite_urls'])
{
$tags[] = "a";
$links[] = "href";
}
if($_dude_config['rewrite_imgs'])
{
$tags[] = "img";
$links[] = "src";
}
if(!$tags)
{
return $content;
}
$tags = "(".join("|", $tags).")";
$links = "(?:".join("|", $links).")";
if($_dude_config['use_list_black'] && $_dude_config['rewrite_urls'])
{
$content = preg_replace_callback("#(<a[^>]+?href\s*=\s*(\"|'))(https?://.+?)\\2(.*?>)(.*?)</a\s*>#ism", 'dude_smart_leech_rewrite_urls_black', $content);
}
$content = preg_replace_callback("#(<{$tags}[^>]+?$links\s*=\s*(\"|'))(https?://.+?)\\3(.*?>)#ism", 'dude_smart_leech_rewrite_urls', $content);
return $content;
}
function dude_smart_leech_rewrite_urls($m)
{
global $config;
static $domain, $tags, $baseurl, $baseurllen;
$m[4] = htmlspecialchars_decode($m[4]);
if(!$domain)
{
$domain = strtolower($_SERVER['HTTP_HOST']);
if(substr($domain, 0,4) == "www.")
{
$domain = substr($domain, 4);
}
$tags = array();
$tags['a'] = "a";
$tags['img'] = "i";
$baseurl = rtrim($config['http_home_url'],"/")."/";
$baseurllen = strlen($baseurl);
}
global $_dude_config;
if(trim($_dude_config['noreplace_flag']) && strpos($m[0], $_dude_config['noreplace_flag']))
{
return $m[0];
}
$urlinfo = parse_url($m[4]);
$host = strtolower($urlinfo['host']);
if(substr($host, 0,4) == "www.")
{
$host = substr($host,4);
}
if(strpos($m[0], 'onclick="return hs.expand(this)"'))
{
return $m[0];
}
if($host == $domain || $host == "seodude.ru")
{
if($_dude_config['getleeched'])
{
$path = basename($urlinfo['path']);
if($path == "go.php")
{
parse_str($urlinfo['query'], $params);
$url = $params['url'];
$url = @base64_decode ( $url );
$url = str_replace ( "&", "&", $url );
$m[4] = $url;
$urlinfo = parse_url($url);
$host = strtolower($urlinfo['host']);
if(substr($host, 0,4) == "www.")
{
$host = substr($host,4);
}
}
else
{
return $m[0];
}
}
else
{
return $m[0];
}
}
if($_dude_config['use_list_white'] && @in_array($host, $_dude_config['list_white']))
{
return $m[0];
}
$_url = $_dude_config['encrypt'] ? base64_encode($m[4]) : $m[4];
$url = rtrim($config['http_home_url'],"/").DUDE_OUT_PAGE_URL;
$url .= "?".urlencode($tags[$m[2]].":".$_url);
if($_dude_config['usenoindex'] || $_dude_config['usenofollow'])
{
$rel = array();
if($_dude_config['usenoindex'])
{
$rel[] = 'noindex';
}
if($_dude_config['usenofollow'])
{
$rel[] = 'nofollow';
}
$rel = " rel=\"".join(",", $rel)."\" ";
$m[5] = $rel.$m[5];
}
$m = $m[1].$url.$m[3].$m[5];
return $_dude_config['usenoindex'] ? '<noindex>'.$m.'</noindex>' : $m;
}
function dude_smart_leech_rewrite_urls_black($m)
{
global $_dude_config;
$urlinfo = parse_url($m[3]);
$host = strtolower($urlinfo['host']);
if(substr($host, 0,4) == "www.")
{
$host = substr($host,4);
}
if(@in_array($host, $_dude_config['list_black']))
{
return $m[5];
}
return $m[0];
}
if (!function_exists('htmlspecialchars_decode') )
{
function htmlspecialchars_decode($text)
{
return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
}
}