Plugin throwing “undefined offset”
-
After upgrading to version 1.7.3 of this plugin I started seeing the following errors in my log file:
PHP Notice: Undefined offset: 0 in /home/…/wp-includes/capabilities.php on line 181
I believe that this caused by passing only a single argument to current_user_can. Note in the documentation that ommiting this second $object_id argument will cause just this error. A scan confirmed that the plugin code was not using the $object_id argument.
Eventually I got a stack trace on this which pointed to Admin Menu Editor. I confirmed by deactivating the plugin. The errors disappeared. I then downgraded to version 1.7.2. No issues there as well. The problem seems to be only in 1.7.3.
Thanks, Max
- The topic ‘Plugin throwing “undefined offset”’ is closed to new replies.