Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Undefined array key 0 in (...)class.tx_caretakerinstance_Operation_CheckPathExists.php line 56 #92

@julianhofmann

Description

@julianhofmann

Line 56 is list($path) = glob($path);.

Here list() assigns the index 0 of glob($path). glob() returns an array containing the matched files/directories, an empty array if no file matched or false on error. The last two cases will fail to be assigned because there is no entry in the array - or it is no array (false).

This use-case might be caused by not setting any paths to be checked.
Looking to tx_caretakerinstance_CheckPathTestService.php#L63: $paths = explode(chr(10), $paths);
$path will be a non-empty array even if the separator is not found ("If separator contains a value that is not contained in string and a negative limit is used, then an empty array will be returned, otherwise an array containing string will be returned. "). Exactly this will be, if $pathsis an empty string - there's no chr(10) in it, and explode() return array(0=>'').
In line 64 this empty string will be processed and cause the above warning due to an invalid/empty path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions