MyBB Community Forums

Full Version: [F] Multiple Smilies PHP Error [R] [C-Chris W B.]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When adding multiple smilies, if you enter the wrong path, you get the two following php errors at the top of the page:

Warning [2] readdir(): supplied argument is not a valid Directory resource - Line: 303 - File: [admin_folder]/modules/config/smilies.php PHP 5.2.9 (Linux)

Warning [2] closedir(): supplied argument is not a valid Directory resource - Line: 317 - File: [admin_folder]/modules/config/smilies.php PHP 5.2.9 (Linux)

Supplying the correct path allows the function to work as expected.
I can reproduce this. The error appears because it inserts the specified directory, and uses that as the file path. When that file path does not exist, it gives a path error.

Possible fix: In admin/modules/config/smilies.php find (at line 290):
			if($path)

Replace with:
			if($path && !$errors)

It appears to fix the bug on localhost with no issues.
I can also reproduce this. Scoutie44's fix works on mine too.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group