-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Laura Scott schrieb:
On Sep 14, 2007, at 8:56 AM, Augustin (Beginner) wrote:
On Thursday 13 September 2007 19:49, Earnie Boyd wrote:
Quoting "Augustin (Beginner)" drupal.beginner@wechange.org:
<?php if ($node->title_prepend): print '<span class="node-label">'. $node->title_prepend .' </span>'; endif; ?>
Don't you need to protect against the non-existence of $node->title_prepend or is it guaranteed to be present at this point?
You are right. I am supposed to use isset().
<code> <?php if (isset($node->title_prepend)): print '<span class="node- label">'. $node->title_prepend .' </span>'; endif; ?> </code>
And you want to prettify this code.
Here's a simpler solution (I think) but maybe this approach has been deprecated as it's something I used back in the 4.6 days....
<?php print $node->type ?>
In the 4.6 days we didn't have node types which where named by users in core. Now that we have them, $node->type should be regarded as user input and sanitized on output:
<?php print check_plain($node->type); ?>
Cheers, Ger»yes, it may seem overzealous«hard