Beispiel #1
0
function CLT($text)
{
    //convertir url en titre le plus proche
    $text = trim(Str_ireplace(array('c.html', '/Q.', 'p.html', '.sh', "frontalier74", "frontaliers", "creditimmo", "a74", "s74", "xzxzx", "index", "2007", "_vd", "z/", "y/", "http://", ".fr/"), '', $text), '&? ');
    $text = Preg_replace("~\\.(shtml|html|php|php5)\$~is", '', $text);
    $text = Preg_replace("~^/?s\\.~is", '', $text);
    $text = trim(Preg_Replace("~\\.((ch|co|com|fr|org|biz|info)/?|(shtml|html|htm|php|fla|jpg|bg|K)\$)~", ' ', $text));
    $text = Str_ireplace(array('%E0', "%e0", 'à'), 'a', $text);
    #,"f.","a."
    $text = Str_ireplace(array("1rachat-credit", "portail-patrimoine"), 'rachat de credit', $text);
    $text = eregi_replace("(c|p)?.html", '', $text);
    $text = ereg_replace("_([0-9]+)|^([0-9]+)-|-([0-9]+)|\\.([0-9]+)|\\/([0-9]+)|htm.\$", "", $text);
    //Les nombes en trop en paramètres ..
    $text = ucfirst(trim(str_replace(array("%20", "-", "_", "/", ".", ",", '|'), " ", $text)));
    #ore processing factory
    $pos = strpos($text, '?', 0);
    if ($pos > 0) {
        Preg_match_all("~=([^&]+)~is", $text, $t);
        $text = substr($text, 0, $pos);
        if ($t) {
            $t = $t[1];
            $text .= implode(' ', $t);
        }
    }
    return $text;
    //Supprimer le Get de merde, non, en aucun cas, on le conserve
}
Beispiel #2
0
function kwd($ref)
{
    GT('k2');
    if (Preg_match("~utmctr=([^;|]+)~", $_COOKIE['__utmz'], $t)) {
        return tridecoder($t[1]);
    }
    #adwords failsafe on cookie
    #if($_ENV['yt']['mots']&&$_ENV['yt']['lw']&&$_ENV['yt']['lw']<(now-120)){$x=FGC(ipf,'mots');if(j9==1)Db("ipfmot:$x");Return $x;}
    if (preg_match("~&[q|p]=([^&]+)~i", $ref, $t)) {
        $mots = ask($t);
    } elseif (Preg_match("~cgi-bin.*x_query=([^&]+)~i", $ref, $t)) {
        $mots = $t[1];
    } elseif (Preg_match("~FORID%3A([^&]+)~i", $ref, $t)) {
        $mots = $t[1];
    } elseif (Preg_match("~fr/go.*/([^/]+)~i", $ref, $t)) {
        $mots = $t[1];
    } elseif (Preg_match("~fr/q/(.*).html~i", $ref, $t)) {
        $mots = $t[1];
    } elseif (Preg_match("~&text=([^&]+)~i", $ref, $t)) {
        $mots = $t[1];
    } elseif (Preg_match("~xeoo.*&k=([^&]+)~i", $ref, $t)) {
        $mots = $t[1];
    } elseif (Preg_match("~&(q|p|cx)=([^&]+)~i", $ref, $t)) {
        $mots = ask($t);
    } else {
        $ref = preg_replace('~&(searchfor|eingabe|l|key|text|itag|OVRAW|wd|recherche|rds|rch|data|uery|for|str|ing|qs|qt|req|k|q|p)=~is', 'MX=', $ref);
        preg_match_all("~MX=([^&]+)~is", $ref, $t);
        if ($t[1]) {
            $mots = str_replace('MX=', '', $t[0][0]);
        }
    }
    if (strlen($mots) > 3) {
        GT('k3');
        $mots = trim(Preg_replace("~[ ]{2,}~", ' ', str_replace(array('/', 'search&q=', 'http:', 'http', "\\\\'", "\\'", "\\'", '\\', "'", '"', '+', '-', '-', '&', '|', '{', '}', '(', ')', ',', '...', 'ggmain.jhtml ', 'searchfor=', ''), ' ', $mots)));
        $mots = Preg_replace("~'|\"|\\[|\\]~", '', $mots);
        if (is_numeric($mots)) {
            return '';
        }
        return strtolower(cleankeyword(Tridecoder($mots)));
        #"@'|\"|[\\]@"
    }
}
Beispiel #3
0
        die($e[$_GET['e']]);
    }
}
$d = array('ip' => '127.0.0.1', 'HTTP_HOST' => 'cli');
foreach ($d as $k => $v) {
    if (!isset($a[$k])) {
        $a[$k] = $v;
    }
}
#default values for php CLI !!!
#define basic variables U && CWD here..
if (!$a['QUERY_STRING'] && $a['REoDIRECT_QUERY_STRING']) {
    $a['QUERY_STRING'] = $a['REDIRECT_QUERY_STRING'];
}
#passing RQS for 404
$D = ['SN' => $a['SCRIPT_NAME'], 'SFN' => $a['SCRIPT_FILENAME'], 'H' => str_replace(array(':81', ':80'), '', strtolower($a['HTTP_HOST'])), 'DR' => str_replace('Program Files', 'Progra~1', $a['DOCUMENT_ROOT']), 'nu' => substr($a['SCRIPT_NAME'], 1), 'u' => substr(Preg_replace("~(\\?|&)(go=|gclid=).*|www\\.~is", '', $a['REQUEST_URI']), 1), 'cwd' => str_replace('/home/www', '/z', getcwd()) . '/', 'server' => $a['ip'], 'sip' => $a['ip'], 'sa' => $a['ip'], 'status' => $a['REDIRECT_STATUS'], 'rs' => $a['REDIRECT_STATUS'], 'rqs' => $a['REDIRECT_QUERY_STRING'], 'rh' => $a['REMOTE_HOST'], 'host' => $a['REMOTE_HOST'], 'q' => $a['QUERY_STRING'], 'ru' => $a['REMOTE_USER'], 'ip' => $a['REMOTE_ADDR'], 'ua' => $a['HTTP_USER_AGENT'], 'refe' => strtolower($a['HTTP_REFERER']), 'now' => time(), 'DATE' => date('YmdHis')];
foreach ($D as $k => $v) {
    redef($k, $v, 1);
}
$d = array('args', 'DB', 'root', 'tracker', 'starter', 'obstart', 'REDIRECT_QUERY_STRING', 'REDIRECT_STATUS', 'REMOTE_HOST', 'REMOTE_USER', 'HTTP_REFERER');
foreach ($d as $k) {
    if (!isset($a[$k])) {
        $a[$k] = null;
    }
}
#set to null if not set
redef('PATHANOT', TMP . 'anot/' . str_replace('/', '-', H . SN) . '.igb');
$anotations = [];
redef('SR', 'http' . ($a['HTTPS'] ? 's' : '') . '://' . H . '/', 1);
redef('SURL', SR . U, 1);
redef('SU', SR . U, 1);
Beispiel #4
0
function BadQ($x)
{
    Rem($GoodPatterns, $_ENV['GP'], 'x|e|t|q|p|lt|aid|nb|v|letter|web|css|js|rss|gss');
    #Utilisées, donc acceptés par défaut
    $x = Preg_replace("~[?|&](([0-9]+|" . badqueries . ")(=[^&]+)?)~is", '', $x);
    $x = Preg_replace("~\\?(.*)/\$~i", "?\\1", $x);
    #paramètres étranges ..
    if (!strpos($x, '=') && $_ENV['soloQ']) {
        $GoodPatterns .= '|' . $_ENV['soloQ'];
        #et on les ajoute aux good patterns as well :)
        $x = Preg_replace("~\\?(?!({$_ENV['soloQ']}))[^&]+~is", '', $x);
        #Si valeur attendues toutes declarées $_ENV['soloQ']="css|js";
    }
    return trim(Preg_replace("~[?|&](?!({$GoodPatterns}))([^=]+)=([^&]+)~is", '', $x), '?& ');
    #Remove Bad things out of here
}
Beispiel #5
0
function CorrectMu($x)
{
    return Preg_replace('~(\\.(info|com|org|ch|fr))/~', "\$1", $x);
}