value can be something else than a string

if the value is not a string (an array for instance), sprintf will fail
This commit is contained in:
Thomas Portelange 2018-09-26 11:35:40 +02:00 committed by GitHub
parent a31a496362
commit f103648f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1326,13 +1326,14 @@ class FormField extends RequestHandler
*/
public function debug()
{
$strValue = is_string($this->value) ? $this->value : print_r($this->value, true);
return sprintf(
'%s (%s: %s : <span style="color:red;">%s</span>) = %s',
static::class,
$this->name,
$this->title,
$this->message,
$this->value
$strValue
);
}