Issue Bug Closed

#66423FAL Indexer createIndexEntry careless about non-string compatible values in exception message

Claus Due 04/14/15, 16:36 updated 06/07/19, 11:31

Description

As topic says: when Indexer::createIndexEntry is called with something that is not string-compatible (which is the case for File instances, for example) then the possibly-object variable $identifier is inserted as part of the exception message without first checking if it can be converted to a string. Subsequently, the error message that gets dispatched is a php warning converted to exception – instead of the intended InvalidArgumentException.

Suggested fix: check type of variable; if object without __toString, use gettype($identifier) as part of exception message instead.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.