IMCE just hangs when opening due to infinite loop in dir_opendir

On line 909:
if (!isset($response->body->IsTruncated) || $response->body->IsTruncated === 'false') {
$truncated = FALSE;
}

This never gets evaluated to true (so $truncated gets set to FALSE). The fix is just to change to == instead of ===

if (!isset($response->body->IsTruncated) || $response->body->IsTruncated == 'false') {

I believe the issue is that this is not a string but a CFSimpleXML object and either you need == or to cast it to a string before comparing with ===.

Attached is a patch to make the change above.

CommentFileSizeAuthor
opendir_istruncated_infinite_loop.patch725 bytesmhenning
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AliMartin’s picture

Life saver, many thanks for supplying this patch :)

vanvemden’s picture

The patch works, and thanks!

justafish’s picture

Status: Fixed » Closed (fixed)

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