PHP Fatal error: Cannot use string offset as an array in .../upload.module on line 615

Adding something into upload_js() such as:

if (!isset($_POST['form_build_id'])) exit;

should do the trick

Comments

mfb’s picture

Title: Fatal error if accessing AHAH callback directly » AHAH callback fatal error scenarios

I've also been getting the PHP Fatal error: Cannot use string offset as an array in modules/upload/upload.module on line 615 in my logs.

You don't just have to access the callback directly. Another way it happens is if you "Clear cached data" at admin/settings/performance while someone is uploading files. The cache this callback is loading has unexpectedly disappeared and it craps out with the fatal error.

IMO "clearing cached data" should not cause a fatal error or a destructive disruption to users who are in the midst of using a form.

If there's no work-around then there should be some warning for admins about issues their users could have if the button is clicked.

dpearcefl’s picture

Status: Active » Postponed (maintainer needs more info)

Does this issue exist in current D6?

mfb’s picture

Status: Postponed (maintainer needs more info) » Fixed

As far as I know, the fatal error was resolved by security fixes in Drupal 6.4: http://drupalcode.org/project/drupal.git/commit/49f719f7c4f7c1b69dc35ff8...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.