1
JammerPro
Banners
  • 2009/11/1 22:34

  • JammerPro

  • Just popping in

  • Posts: 39

  • Since: 2008/8/24


The Banners Module has a bug... The click through does not work. A new window pops up, but it is blank.

All my hyperlinks are correct (I have been using XOOPS for a long time and I know how to program in PHP)...

This is definitely a bug as I confirmed same by doing a clean install on another domain.

It might be of help to say that both domains have PHP 4.3.9...

2
ghia
Re: Banners
  • 2009/11/1 22:52

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


About which module are you talking (URL, version)?

Is it a problem you observe after a recent install or is the module already a long time in use? Or the problem is found after upgrade to 2.4.0?

3
JammerPro
Re: Banners
  • 2009/11/2 8:18

  • JammerPro

  • Just popping in

  • Posts: 39

  • Since: 2008/8/24


This is a problem with "Banners" under the "System" that comes with the 2.4.0 new distribution of XOOPS. After a fresh, clean install of the new XOOPS 2.4.0, the banner is displayed, but when the user clicks on it, only a blank new window appears... I have activated "Banners."

Hope this has clarified the BUG...

4
ghia
Re: Banners
  • 2009/11/2 9:43

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Standard (using the default or zetagenesis theme) the flash banner /images/banners/xoops_flashbanner2.swf is active (on the right) and points to /banners.php?op=click&bid=1 which leads to this site (xoops.org).
On the left there is the logo, which links to the home of the site (/).

5
trabis
Re: Banners
  • 2009/11/2 10:29

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Mowaffak as reported same bug but I could not reproduce it on my sites.

in banners.php line 310 this check is failing:
if ($GLOBALS['xoopsSecurity']->checkReferer()) {


which leads to class/xoopssecurity.php:
function checkReferer($docheck 1)
    {
        
$ref xoops_getenv('HTTP_REFERER');
        if (
$docheck == 0) {
            return 
true;
        }
        if (
$ref == '') {
            return 
false;
        }
        if (
strpos($refXOOPS_URL) !== 0) {
            return 
false;
        }
        return 
true;
    }


which leads to include/functions.php
function xoops_getenv($key)
{
    
$ret '';
    if (
array_key_exists($key$_SERVER) && isset($_SERVER[$key])) {
        
$ret $_SERVER[$key];
        return 
$ret;
    }
    if (
array_key_exists($key$_ENV) && isset($_ENV[$key])) {
        
$ret $_ENV[$key];
        return 
$ret;
    }
    return 
$ret;
}


Can anyone see where the bug might be?

6
ghia
Re: Banners
  • 2009/11/2 10:47

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Some possibilities for failure:
- surfing with a browser security extension that suppresses the referer.
- having the www different included/excluded in URL and definition
- Access by https?
Maybe one bug on some PHP versions with some strict settings:
if (strpos($refXOOPS_URL) !== false) {

(cfr SEO rewrite)
This may apply on a lot of places in the core.

7
JammerPro
Re: Banners
  • 2009/11/2 15:52

  • JammerPro

  • Just popping in

  • Posts: 39

  • Since: 2008/8/24


Quote:
Some possibilities for failure:
- surfing with a browser security extension that suppresses the referer.
- having the www different included/excluded in URL and definition
- Access by https?


This is definitely a bug... I was using IE (latest), which brought up the empty window for all 3 instances above.

Firefox inconsistently makes it to the URL you list but not to its alter ego (if you enter at http://yourdomain.com, the click through won't go to a www or https address)...

Note, I do have XOOPS Protector installed and running...

Thanks for looking in to this in advance. I'm sure this is a BUG...


8
ghia
Re: Banners
  • 2009/11/2 16:34

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


There should maybe also an error redirect or something before the last exit in the clickBanner function, because the exit without any message is a bit harsh.
(Seems it has always been like that in 2.0.x and 2.2.x too)

9
ghia
Re: Banners
  • 2009/11/2 16:49

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Made me thinking about this exit statement and its use.

Seems there are other places where the script simply halts with it. I think debugging and stability will be improved, when these are tackled.

eg: imagemanager.php
if (!isset($_REQUEST['target'])) {
    exit();
}
As a minimum a string argument could be provided to inform the user about the problem.
exit('No target specified');


header.php
if ( $xoTheme->checkCache() ) {
  exit();
}

etc.

10
Mamba
Re: Banners
  • 2009/11/2 17:32

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


I can confirm that IE8 has problems on both PHP4 and PHP5. I turned off the IE Protected mode, but the problem was still there.

IE tries to open a new window with the link, but instead of redirecting it to the destination, it get stuck there with the XOOPS Banner link. No errors are present.

Refreshing of the browser doesn't help.

I didn't have any problems on FF and Chrome.

Login

Who's Online

241 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 241


more...

Donat-O-Meter

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

Latest GitHub Commits