xoops forums

irmtfan

Module Developer
Posted on: 2013/4/17 5:54
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#1

XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect

IF eventCoreIncludeFunctionsRedirectheader in system module runs it will exit()
IMO It is a bug in XOOPS255/modules/system/preloads/core.php
IMO exit() should be commented or we should find some way to make sure all other eventCoreIncludeFunctionsRedirectheader events will run before any exit();
if (!headers_sent() && isset($xoopsConfig['redirect_message_ajax']) && $xoopsConfig['redirect_message_ajax']) {
    
$_SESSION['redirect_message'] = $args[2];
    
header("Location: " preg_replace("/[&]amp;/i"'&'$url));
    exit(); 
// IMO exit() should be commented 
}

So it is impossible to use eventCoreIncludeFunctionsRedirectheader in another module.

Or we can use return false and then in redirect_header function use exit() if it return false.

In userlog i end up with a tricky solution.
I shift the position of userlog to the top of 'system_modules_active' cache file list.
so now it is like this:
return array (
  
=> 'userlog',
  
=> 'system',
  
=> 'pm',


and because preload class read/run events in the module order it will run eventCoreIncludeFunctionsRedirectheader event in userlog first and then run it in system module.

PS: please somebody add this to sf.net bug tracker.

Cesagonchu

Moderator
Posted on: 2013/4/17 7:15
Cesagonchu
Cesagonchu (Show more)
Moderator
Posts: 869
Since: 2010/2/1 2
#2

Re: XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect

Done.

irmtfan

Module Developer
Posted on: 2013/4/17 8:19
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#3

Re: XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect

Thank you Cesag.
It will be good for tracking.
But we can discuss here.

Mamba

Moderator
Posted on: 2013/9/21 4:50
Mamba
Mamba (Show more)
Moderator
Posts: 10828
Since: 2004/4/23
#4

Re: XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect

This has been fixed by Richard:
https://sourceforge.net/p/xoops/bugs/1265/#1ed1
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

irmtfan

Module Developer
Posted on: 2013/9/25 14:54
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#5

Re: XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect

Good fix but it will break the module in previous xoops versions.
I mean module will only works in 2.5.7.
Anyway I think only userlog used this preload.