View Issue Details

IDProjectCategoryView StatusLast Update
0001051mantisbtbugtrackerpublic2001-10-28 22:15
Reporteraarjona Assigned Toprescience  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0001051: problems with view_all_bugs_page.php in 0.15.9
Description

Setup:
Mantis 0.15.7 database .Upgrade attempt, didn't work out so I tried:
Mantis 0.15.9 clean install (including database generation)
MySQL 3.23.42-nt
php 4.0.6 CGI mode
Windows NT 4.0 SP6a

everything seems ok, but when I click on View Bugs, it seems to get on an endless loop. It won't load the page, no matter how long I wait.
php.exe resource usage raises.

0.15.7 ran fine

TagsNo tags attached.

Activities

prescience

prescience

2001-10-26 15:21

reporter   ~0001470

What browser, version, platform is this with?

aarjona

aarjona

2001-10-26 15:40

reporter   ~0001473

My setup:
Windows 2000 Profesional Service Pack 2 + hotfixes
IE 5.5 Service pack 1
Mozilla 0.9.5

aarjona

aarjona

2001-10-27 08:40

reporter   ~0001489

I have been looking around the code and what I could observe is that the problem has something to do with print_header_redirect() and setting cookies.

Case in point:
The login screen. With Quick Proceed on the I get bounced back to the login page. Quick Proceed uses print_header_redirect() to send me to the correct page after a login attempt. The thing is that when quick proceed is on, the cookies do not get created/updated, so in the next page (login_select_proj_page.php for example) the login check fails, and I get bounced back to the login page.

The problem with view_all_bug_page.php is that it checks to see if the correct cookie is set, if it is not, it sets it and print_header_redirect()'s me back to the same page. Since when print_header_redirect() is used the cookies are not being created/updated, the check fails and I get redirected to view_all_bug_page.php over and over. Seems like it is redirecting before the cookies are set for some reason.

My server setup is the following:
Windows NT 4.0 Service Pack 6a
PHP 4.0.6 running in CGI mode

Noticed that quick proceed it on here and the cookies are written, but then it's another webserver and another OS.

aarjona

aarjona

2001-10-27 09:30

reporter   ~0001490

Looking around the PHP Manual notes for setcookie() found the solution. The problem is a bug in IIS when running CGI's (KB article: <a href="http://support.microsoft.com/support/kb/articles/Q176/1/13.ASP">http://support.microsoft.com/support/kb/articles/Q176/1/13.ASP</a>).
When the header Location is used, messes up with Set-Cookie.

The solution is using Refresh.

in line 20 in core_print_API.php change
header( "Location: $p_url" );
for
header( "Refresh: 0;url=$p_url" );

This solves both the looping I had at the login screen with Quick Proceed enabled, and this bug.

prescience

prescience

2001-10-27 09:39

reporter   ~0001491

Ok, so since it's a MS bug I can just create a new global to fix this. I'll get this into CVS shortly.

aarjona

aarjona

2001-10-27 09:48

reporter   ~0001492

well, as far as I have seen, it works exactly the same way as Location works here. Wouldn't it be more efficient to just make the change in core_print_API.php instead of making a new global?

My 2 cents

prescience

prescience

2001-10-27 10:02

reporter   ~0001494

It's not standard behavior and it works correct for Apache. That tells me that this should be an exception case for IIS. Even MS states that this is a bug.

aarjona

aarjona

2001-10-27 11:29

reporter   ~0001496

No problemo,
but I forgot to mention that if one uses
header( "Refresh: 0;url=$p_url" );
then also is necesary to comment
header( "Status: 302" );

because it makes Netscape and IE (5.5 and 5.01 which I tried on) display a "Document contains no data" (NS) and "Server not found" (IEs) message, which somehow makes sense since we'd be trying to do a Refresh: on a Temporarily Moved document. It must be noted that Mozilla 0.9.5 didn't need the commenting of the Status header.

My print_header_redirect now looks like this:

function print_header_redirect( $p_url ) {

header( "Status: 302" );

header( "Content-Type: text/html" );
header( "Pragma: no-cache" );
header( "Expires: Fri, 01 Jan 1999 00:00:00 GMT" );
header( "Cache-control: no-cache, no-cache=\"Set-Cookie\", private" );
header( "Refresh: 0;url=$p_url" );

}

and works fine with IE 5, 5.5, Netscape 4.7 and Mozilla 0.9.5.

prescience

prescience

2001-10-27 14:28

reporter   ~0001497

Great. Thanks, I'll be releasing later tonight or tomorrow.

prescience

prescience

2001-10-28 08:02

reporter   ~0001498

Fixed in CVS. Will be in 0.15.11