#1988 closed defect (bug) (fixed)
plugins admin / Warning: in_array() wrong datatype, line 90
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | highest omg bbq | |
Severity: | major | Version: | 2.0 |
Component: | Administration | Keywords: | admin plugins array error |
Focuses: | Cc: |
Description
in wp-admin\plugins.php, line 90, throws error when accessing the plugins page of the admin. gettype() on the variable in question ($current_plugins) shows it is a string, sted of array.
In 1.5, the fix was to add a precautionary function to check if active plugins is an array or not:
Attachments (1)
Change History (6)
#2
@
19 years ago
So a simple fix would be to throw in an unserialize() in two lines in ./wp-admin/plugins.php:
line 8 -
current: $current = get_settings('active_plugins');
change to: $current = unserialize( get_settings('active_plugins') );
line 70 -
current: $current_plugins = get_settings('active_plugins');
change to: $current_plugins = unserialize( get_settings('active_plugins') );
Instead of this bad fix, I'd suggest a better fix that correctly unserializes the bytestream before it reaches the variable in ./wp-admin/plugins.php
That seems to be a really bad way to fix the error (and it was a bad way to fix it the first time as well) as it doesn't really _fix_ anything except ignore the error. Doing it again will fix the issue of the warnings but will not fix anything if you try to activate a plugin. You'd need to have another precautionary loop around line 10.
I think the issue is that the 'empty' plugin list was stored initially as a string during the clean install procedures and this is what needs to be fixed. I guessing what we see as the string is the empty array represented as a bytestream.