View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0010672 | mantisbt | other | public | 2009-07-02 11:04 | 2010-04-23 23:22 |
Reporter | stappel | Assigned To | vboctor | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 1.2.0rc1 | ||||
Summary | 0010672: in_array() warining in core/access_api.php | ||||
Description | There are multiple warnings in core_access_api.php: This is due to a check with an empty array(). line 169: | ||||
Steps To Reproduce | Up the php error level reporting | ||||
Tags | No tags attached. | ||||
Calling in_array() on an empty array should not cause a notice/warning. I've double checked to make sure. Looking at the latest code, I can see that the variable is initialized as an empty array and then from then on changed as an array. So it doesn't seem like it is ever set to non-array value which would cause an issue. Would it be possible to provide us with the repro steps that causes you to see this error. Also once you reproduced, can you var_dump() the array to know what it is set to at the time. |
|
After some debugging it seems to be a problem with the pluginmanager from http://deboutv.free.fr/mantis/index.php and the new 1.2.0rc1. But still the PHP in_array() function will give the "wrong datatype for second argument" warning if the array you are checking is empty or null. In that case, it appears that PHP doesn't know the type of data for the array argument, even if you define it as an array. So it is always wise to check with empty() before an in_array(). If you do not think this second part should be ammended in the source code, you can close this call. |
|
@stappel, thanks for letting us know. Please note that deboutv's plugin manager is not supported. You should really use the new plugin systems with 1.2.x releases. Hopefully more plugins will be available since 1.2.0rc1 is now available. Please mention in future issues if you have plugin manager or other customizations applied. |
|