Return false in case the passed values are not of type string

Fixes https://github.com/owncloud/core/issues/11042