1
irmtfan
XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect
  • 2013/4/17 5:54

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


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.

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

Done.

3
irmtfan
Re: XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect
  • 2013/4/17 8:19

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


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

4
Mamba
Re: XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect
  • 2013/9/21 4:50

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


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

5
irmtfan
Re: XOOPS 255 and XOOPS 26 bug: redirect header preload in system module will exit() after redirect
  • 2013/9/25 14:54

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


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.

Login

Who's Online

264 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 264


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