Issue #1151176 by Shawn_Smiley: fix undefined offset in _print_pdf_wkhtmltopdf_version().
authorJoao Ventura
Mon, 15 Aug 2011 14:38:26 +0000 (16:38 +0200)
committerJoao Ventura
Mon, 15 Aug 2011 14:39:17 +0000 (16:39 +0200)
print_pdf/print_pdf.module

index e59f780..4a4b451 100644 (file)
@@ -650,7 +650,8 @@ function _print_pdf_wkhtmltopdf_version() {
   $cmd = realpath($print_pdf_pdf_tool) . ' --version';
   $process = proc_open($cmd, $descriptor, $pipes, NULL, NULL);
   if (is_resource($process)) {
-    $out = preg_match('!.*?(\d+\.\d+\.\d+).*$!m', stream_get_contents($pipes[1]), $matches);
+    $content = stream_get_contents($pipes[1]);
+    $out = preg_match('!.*?(\d+\.\d+\.\d+).*$!m', $content, $matches);
     fclose($pipes[0]);
     fclose($pipes[1]);
     fclose($pipes[2]);