I've wondered why $node is not defined anymore in my theme's page.tpl.php.
The reason is a modified expression in phptemplate.engine, which now reads:

if ((arg(0) == 'node') && is_int(arg(1))) {

arg(1) may be the node number, but it is a string variable, and therefore this check is always false.
is_int should be replaced with the code given in the patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Robrecht Jacques’s picture

FileSize
739 bytes

Rerolled the patch (and changed the coding: eg Drupal uses "&&", not "and"). I think wiz is correct: you should use "is_numeric" here, not "is_int".

Dave Cohen’s picture

Consider: if (arg(1) && ctype_digit(arg(1)));

reportedly performs better than is_numeric(), and true only for integers.

Dries’s picture

Status: Needs review » Fixed

Committed to HEAD.

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)