2008-09-27, 01:26 AM
This line is the problem.
Line 142 of newthread.php
It appears to be right as far as each variable is what it should be. So I guess it's related to the logic. I am pretty sure this is the line though causing the issue. I will try to find one that works.
Fixed.
The second operator looks for if max attachments = 0 OR attachcount is less than max attachments. It was set to AND...it's impossible for them both to be true.
Also some error handling should be added if this fails because no errors are displayed like "max attachments reached" or anything.
I tried to test my fix in all scenarios but of course I hope the mybb team does it's best to make sure I didn't screw up.![Smile Smile](https://community.mybb.com/images/smilies/smile.gif)
Hey just noticed this:
Ryan..your upgrade (changed files) from 1.4.1 to 1.4.2 has the correct line however...the current MYBB 1.4.2 from front page has the &&.
At mybb central I looked at my file wondering why it worked and well..I had your changed files package with the OR statement.![Smile Smile](https://community.mybb.com/images/smilies/smile.gif)
So I guess you need to change the download on home page and possible release a notice or whatever the heck you decide to do.
Thanks.
Line 142 of newthread.php
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && $mybb->settings['maxattachments'] == 0 && $attachcount < $mybb->settings['maxattachments'])
It appears to be right as far as each variable is what it should be. So I guess it's related to the logic. I am pretty sure this is the line though causing the issue. I will try to find one that works.
Fixed.
if($_FILES['attachment']['size'] > 0 && $forumpermissions['canpostattachments'] != 0 && ($mybb->settings['maxattachments'] == 0 || $attachcount < $mybb->settings['maxattachments']))
The second operator looks for if max attachments = 0 OR attachcount is less than max attachments. It was set to AND...it's impossible for them both to be true.
Also some error handling should be added if this fails because no errors are displayed like "max attachments reached" or anything.
I tried to test my fix in all scenarios but of course I hope the mybb team does it's best to make sure I didn't screw up.
![Smile Smile](https://community.mybb.com/images/smilies/smile.gif)
Hey just noticed this:
Ryan..your upgrade (changed files) from 1.4.1 to 1.4.2 has the correct line however...the current MYBB 1.4.2 from front page has the &&.
At mybb central I looked at my file wondering why it worked and well..I had your changed files package with the OR statement.
![Smile Smile](https://community.mybb.com/images/smilies/smile.gif)
So I guess you need to change the download on home page and possible release a notice or whatever the heck you decide to do.
Thanks.