htmlspecialchars() expects parameter 1 to be string, object given in krumo::_array()
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3011051. -->
Reported by: [JBHUTT09](https://www.drupal.org/user/3490839)
>>>
<p>Getting the following warnings and the white page of death:</p>
<p><strong>Warning: htmlspecialchars() expects parameter 1 to be string, object given in krumo::_array() (line 1083 of /sites/all/modules/devel/krumo/class.krumo.php).</strong></p>
<p>Easily replicated by adding the following hook to a custom module:</p>
<pre>function MY_MODULE_views_pre_render( &$view ) {<br> dpm( $view );<br>}</pre><p>I've tried modifying class.krumo.php from this:</p>
<pre> if (is_callable($data)) {<br> $_ = array_values($data);<br> ?><br> <span class="krumo-callback"> |<br> (<em class="krumo-type">Callback</em>)<br> <strong class="krumo-string"><span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">echo </span><span style="color: #0000BB">htmlSpecialChars</span><span style="color: #007700">(</span><span style="color: #0000BB">$_</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]);</span><span style="color: #0000BB">?></span></span>::<span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">echo </span><span style="color: #0000BB">htmlSpecialChars</span><span style="color: #007700">(</span><span style="color: #0000BB">$_</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]);</span><span style="color: #0000BB">?></span></span>();</strong></span><br> <span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">}<br> </span><span style="color: #0000BB">?></span></span></pre><p>to this:</p>
<pre> if (is_callable($data)) {<br> $_ = array_values($data);<br> if ( !is_string( $_[ 0 ] ) ) {<br> $_[ 0 ] = 'not a string';//gettype( $_[ 0 ] );<br> }<br> if ( !is_string( $_[ 1 ] ) ) {<br> $_[ 1 ] = 'not a string';//gettype( $_[ 1 ] );<br> }<br> ?><br> <span class="krumo-callback"> |<br> (<em class="krumo-type">Callback</em>)<br> <strong class="krumo-string"><span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">echo </span><span style="color: #0000BB">htmlSpecialChars</span><span style="color: #007700">(</span><span style="color: #0000BB">$_</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]);</span><span style="color: #0000BB">?></span></span>::<span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">echo </span><span style="color: #0000BB">htmlSpecialChars</span><span style="color: #007700">(</span><span style="color: #0000BB">$_</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]);</span><span style="color: #0000BB">?></span></span>();</strong></span><br> <span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #007700">}<br> </span><span style="color: #0000BB">?></span></span></pre><p>But that just gives the white screen of death with no warnings at all. I am completely and utterly lost.</p>
issue