switch ($delta) {
case 'print-links':
$nid = preg_replace('!^node/!', '', $_GET['q']);
- if (is_numeric($nid)) {
+ if (ctype_digit($nid)) {
$node = node_load($nid);
}
else {
function _print_get_title($path) {
$path = drupal_get_normal_path($path);
$nid = preg_replace('!^node/!', '', $path);
- if (is_numeric($nid)) {
+ if (ctype_digit($nid)) {
$res = db_query("SELECT title FROM {node} WHERE nid = :nid", array(':nid' => $nid))
->fetchField();
}
}
if (!empty($args['path'])) {
$nid = preg_replace('!^node/!', '', drupal_get_normal_path($args['path']));
- if (is_numeric($nid)) {
+ if (ctype_digit($nid)) {
$args['node'] = node_load($nid);
}
}
$path = '';
}
}
- if (!is_numeric($path)) {
+ if (!ctype_digit($path)) {
// Indirect call with print/alias
// If there is a path alias with these arguments, generate a printer-friendly version for it
$path = drupal_get_normal_path($path);
}
}
$parts = explode('/', $path);
- if (is_numeric($parts[0]) && (count($parts) == 1)) {
+ if (ctype_digit($parts[0]) && (count($parts) == 1)) {
$print = _print_generate_node($path, $cid, $format, $teaser, $message);
}
else {
$path = explode('/', $_GET['q']);
unset($path[0]);
$path = implode('/', $path);
- if (is_numeric($path)) {
+ if (ctype_digit($path)) {
$path = "node/$path";
}
// Printer-friendly URLs is on, so we need to make it absolute
// Handle node tabs
$parts = explode('/', $path);
- if (is_numeric($parts[0]) && (count($parts) > 1)) {
+ if (ctype_digit($parts[0]) && (count($parts) > 1)) {
$path = 'node/' . $path;
}
}
if (!empty($args['path'])) {
$nid = preg_replace('!^node/!', '', drupal_get_normal_path($args['path']));
- if (is_numeric($nid)) {
+ if (ctype_digit($nid)) {
$args['node'] = node_load($nid);
}
}
}
if (!empty($args['path'])) {
$nid = preg_replace('!^node/!', '', drupal_get_normal_path($args['path']));
- if (is_numeric($nid)) {
+ if (ctype_digit($nid)) {
$args['node'] = node_load($nid);
}
}