Menu

#1 fix for infinite loop & DB error

open
nobody
None
5
2002-08-04
2002-08-04
Ian Baker
No

includes/sessions.php uses the "GENERAL_ERROR" error
code when a database error occurs. It should be using
CRITICAL_ERROR, since when message_die sees a
GENERAL_ERROR, it'll try to start a session before
returning the error, thereby causing the error
condition to happen again, which calls message_die
again, etc. It's particularly frustrating for the
user, since the problem becomes very difficult to debug.

Now, the error that was causing all this to be an issue
in the first place: sessions.php didn't know what to
insert into the phpbb_users.avatar_width and
avatar_height columns. I'm guessing that these were
placed there by a hack of some sort, and aren't there
in the standard distribution (I don't know -- it's not
my board, I was just called in to fix it). I made a
quick fix to sessions.php to insert 0 into both columns
but what should happen is that the columns should be
explicitly named in the query, like:

insert into phpbb_users (user_id, username, etc) values
('3', 'foo', 'etc')

Many phpbb hacks make slight changes to the phpbb_users
table (mostly, they add columns), and these hacks will
always break your stuff unless you do the insert as
I've explained above...

I've attached my sessions.php to this message. It
makes the first change outlined above, but doesn't take
care of the second one correctly (I'm in a hurry, and
figured it'd be better to submit a patch with the time
than to fix the bug on our installation only).

Thanks for putting the mod together, BTW. My friends
would be lost without it. :)

-Ian

Discussion

  • Ian Baker

    Ian Baker - 2002-08-04

    postnuke/phpBB2 sessions.php

     
  • Dan Bullock

    Dan Bullock - 2002-10-28

    Logged In: YES
    user_id=390332

    I don't see listed for which version this patch applies.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.