Members   Search      Help    Register    Login    Home
Home » Support Forums for PMBT 2.X » Bug Reports for V2.X » phpBB.php Use Of Break Illegal
phpBB.php Use Of Break Illegal [message #2503] Sat, 04 April 2009 11:56 Go to next message
Threedays is currently offline Threedays  Australia
Messages: 79
Registered: January 2009
Location: Australia
Seeder
Not sure if this is a trick that works, but it's illegal to use the break command within IF Statement. Break is supposed to be used within;

http://au2.php.net/manual/en/control-structures.break.php

Quote:

break ends execution of the current for, foreach, while, do-while or switch structure.


In phpBB.php

define('IN_PORTAL', true);

if ($page=="posting.php" && $mode=="smilies") {
	include $phpbb_root_path."posting.php";
	break;
}
if ($page=="posting.php" && $mode=="popup") {
	include $phpbb_root_path."posting.php";
	break;
}
if ($page=="viewonline.php" && $mode=="whois") {
	include $phpbb_root_path."viewonline.php";
	break;
}


I'm taking out the breaks unless it's indented here to exit? I can remove the breaks as the conditions shouldn't match others is one if matched.

There are other breaks throughout the script. Any help welcome, Rob or others.


[Updated on: Sat, 04 April 2009 12:02]

Report message to a moderator

Re: phpBB.php Use Of Break Illegal [message #2508 is a reply to message #2503] Mon, 06 April 2009 16:40 Go to previous messageGo to next message
Revan is currently offline Revan  Czech Republic
Messages: 125
Registered: April 2007
Super-Seeder
yeah i remember seeing this...
if it bothers you just rewrite the code so instead of multiple if's you'll have a switch where you can use break as you please...
or maybe - dont take my word on this, i havent worked with php in quite a while, you could use return instead of break in these ifs
Re: phpBB.php Use Of Break Illegal [message #2510 is a reply to message #2508] Tue, 07 April 2009 00:38 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
It don't matter because it well never got to the break as die(); is called there fore break is never reached.
The breaks where added when it was phpBB2 and never removed.


http://a.imageshack.us/img831/5562/mybikes.png

[Updated on: Tue, 07 April 2009 00:39]

Report message to a moderator

Re: phpBB.php Use Of Break Illegal [message #2515 is a reply to message #2503] Fri, 10 April 2009 05:59 Go to previous message
Threedays is currently offline Threedays  Australia
Messages: 79
Registered: January 2009
Location: Australia
Seeder
One of the conditions did get meet with attachments in my forum.

I changed the breaks to exit()'s


Previous Topic:ForumAdd Error - cache.php
Next Topic:problem with downloading and uploading
Goto Forum:
  


Current Time: Wed Feb 08 11:59:56 GMT 2012

Total time taken to generate the page: 0.00684 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software