diff --git a/print.pages.inc b/print.pages.inc index 1ab082c0694f4eaabdbc9a91c3c8bef0334aea77..c54a34ef59217fe8d40f9e567559b2de39967095 100644 --- a/print.pages.inc +++ b/print.pages.inc @@ -30,14 +30,14 @@ function print_controller_html() { drupal_send_headers(); print $html; - $nodepath = (isset($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path; + $nodepath = (isset($node->path) && is_string($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path; db_merge('print_page_counter') ->key(array('path' => $nodepath)) ->fields(array( 'totalcount' => 1, 'timestamp' => REQUEST_TIME, )) - ->expression('totalcount', 'totalcount + :inc', array(':inc' => 1)) + ->expression('totalcount', 'totalcount + 1') ->execute(); } } @@ -81,7 +81,7 @@ function print_controller($path, $cid = NULL, $format = PRINT_HTML_FORMAT, $teas $path = $alias; } $parts = explode('/', $path); - if ($parts[0] == 'node') { + if (($parts[0] == 'node') && (count($parts) > 1)) { array_shift($parts); $path = implode('/', $parts); } diff --git a/print_mail/print_mail.inc b/print_mail/print_mail.inc index c728b76acd1df9b808ac43572bef3944d4f18116..6bb612e64fa02fd4ed43eaffdbd9da7372ea0491 100644 --- a/print_mail/print_mail.inc +++ b/print_mail/print_mail.inc @@ -62,7 +62,7 @@ function print_mail_form($form, &$form_state) { 'totalcount' => 1, 'timestamp' => REQUEST_TIME, )) - ->expression('totalcount', 'totalcount + :inc', array(':inc' => 1)) + ->expression('totalcount', 'totalcount + 1') ->execute(); } diff --git a/print_pdf/print_pdf.pages.inc b/print_pdf/print_pdf.pages.inc index b07f5c61469f26ed28dcb74bbbc46c7df8ef9642..6f78f5ca25c98c22125256351d4dc2077d260622 100644 --- a/print_pdf/print_pdf.pages.inc +++ b/print_pdf/print_pdf.pages.inc @@ -54,14 +54,14 @@ function print_pdf_controller() { exit; } - $nodepath = (isset($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path; + $nodepath = (isset($node->path) && is_string($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path; db_merge('print_pdf_page_counter') ->key(array('path' => $nodepath)) ->fields(array( 'totalcount' => 1, 'timestamp' => REQUEST_TIME, )) - ->expression('totalcount', 'totalcount + :inc', array(':inc' => 1)) + ->expression('totalcount', 'totalcount + 1') ->execute(); }