1
Audio
Re: HTTP_REFERER Error
  • 2005/8/29 2:01

  • Audio

  • Just popping in

  • Posts: 1

  • Since: 2005/8/29


I had the HTTP_REFERER problem too, and it was driving me up the wall. I finally tracked down a fix here:

https://xoops.org/modules/smartfaq/faq.php?faqid=310

The fix at that URL is for pre-2.2.x versions. So here's the hack for 2.2.x versions:

Open the file class/xoopssecurity.php

On line 167 or so you'll find the following code:

/**
    * Check the user agent's HTTP REFERER against XOOPS_URL
    *
    * @param int $docheck 0 to not check the referer
 (used with XML-RPC), 1 to actively check it
    *
    * @return bool
    **/
    
function checkReferer($docheck=1)
    {
        if (
$docheck == 0) {
            return 
true;
        }
        
$ref xoops_getenv('HTTP_REFERER');
        if (
$ref == '') {
            return 
false;
        }
        
$pref parse_url($ref);
        if ( 
$pref['host'] != $_SERVER['HTTP_HOST'] ) {
            return 
false;
        }
        return 
true;
    }


Change

$ref xoops_getenv('HTTP_REFERER');
        if (
$ref == '') {
            return 
false;


to

$ref xoops_getenv('HTTP_REFERER');
        if (
$ref == '') {
            return 
true;


and you're in business.

I have no idea how this affects the overall security of your site, so make this hack at YOUR OWN RISK! The poster at https://xoops.org/modules/smartfaq/faq.php?faqid=310 seems to think it's okay, but you should probably take steps to find out for yourself . . .




TopTop



Login

Who's Online

178 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 178


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits