MyBB Community Forums

Full Version: Errors Flooding Me.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So I keep getting flooded with errors on my email but I cant seem to know what is causing these errors.
These are the current errors:

----------------------
Type: 2
File: inc/functions.php (Line no. 4930)
Message
urlencode() expects parameter 1 to be string, array given

-----------------------------
Type: 2
File: global.php (Line no. 46)
Message
Illegal offset type in isset or empty

I'm using MyBB 1.8.5 and PHP 5.6.11
Any help is appreciated.
Is it possible that you are using this plugin? https://he.wordpress.org/plugins/zingiri...changelog/
In the changelog version 1.1 fixes the urlencode error. (same error could be a coincidence)
(2015-07-29, 03:04 AM)KevinVR Wrote: [ -> ]Is it possible that you are using this plugin? https://he.wordpress.org/plugins/zingiri...changelog/
In the changelog version 1.1 fixes the urlencode error. (same error could be a coincidence)

Nope I dont have any wordpress plugins on my site neither do I use wordpress.
can you downgrade php to 5.5 or 5.4 and check if those errors / warnings persist ..
Now getting:
Type: 2
File: inc/functions.php (Line no. 7890)
Message
strlen() expects parameter 1 to be string, array given

Type: 2
File: inc/datahandlers/user.php (Line no. 534)
Message
trim() expects parameter 1 to be string, array given

Type: 2
File: inc/functions.php (Line no. 7887)
Message
preg_match() expects parameter 2 to be string, array given
in general, those warnings may be ignored. they are based on php version

admin panel >> configuration (settings) >> Server and Optimization Options -->
Use Error Handling --> On
Error Logging Medium --> Log and email Errors
Error Type Medium --> Errors
Alright I will ignore these errors for now.
PHP warnings shouldn't be ignored. Some of them look like bugs, for example the urlencode one, which I guess is for this line: https://github.com/mybb/mybb/blob/featur....php#L4958 $POST['action'] (or anything else) can be an array and the code doesn't consider that, an !is_array($POST[$var]) check should be executed after the isset() verification.

Moving to bug reports for further review. If you have more warnings, please share them.

EDIT: the global.php warning is a bug too, https://github.com/mybb/mybb/blob/featur...al.php#L46 - $mybb->input['action'] can be an array and $nosession[$mybb->input['action']] is invalid syntax in that case. Another !is_array($mybb->input['action']) check is missing after isset().

EDIT2: the strlen() and preg_match() bugs concern these lines: https://github.com/mybb/mybb/blob/featur...7964-L7967 Casting $input to (string) should be added before using it in these functions.

EDIT3: and, similarly, profile field inputs may not be strings and will trigger warnings here: https://github.com/mybb/mybb/blob/fccaf9...r.php#L534 or possibly here: https://github.com/mybb/mybb/blob/fccaf9...r.php#L567 Another (string) casting would be nice.
@Destroy: Are there any else? Also note that some are likely fixed by this PR: https://github.com/mybb/mybb/pull/1527
There most likely are other rare warnings, but I don't know any more currently, except this: http://community.mybb.com/thread-176562.html (I'll push all issues mentioned here and in that topic tommorow if noone has anything to add).

That PR doesn't fix anything mentioned here - it's different, incomplete, it affects only 5 files and some changes are not even useful.
Pages: 1 2