Example #1
0
 function isExternalReferrer(&$request)
 {
     if ($referrer = $request->get('HTTP_REFERER')) {
         $home = SCRIPT_NAME;
         // was SERVER_URL, check sister wiki's: same host but other other script url
         if (substr(strtolower($referrer), 0, strlen($home)) == strtolower($home)) {
             return false;
         }
         require_once "lib/ExternalReferrer.php";
         $se = new SearchEngines();
         return $se->parseSearchQuery($referrer);
     }
     return false;
 }
Example #2
0
function isExternalReferrer(&$request)
{
    if ($referrer = $request->get('HTTP_REFERER')) {
        $home = SERVER_URL;
        // SERVER_URL or SCRIPT_NAME, if we want to check sister wiki's also
        if (string_starts_with(strtolower($referrer), strtolower($home))) {
            return false;
        }
        require_once "lib/ExternalReferrer.php";
        $se = new SearchEngines();
        return $se->parseSearchQuery($referrer);
    }
    //if (DEBUG) return array('query' => 'wiki');
    return false;
}