Explorar o código

Fixes #246 - passing string to Zend_Pdf_Annotation_Link::create results in exception

Frank Brückner %!s(int64=12) %!d(string=hai) anos
pai
achega
040324744b
Modificáronse 1 ficheiros con 6 adicións e 5 borrados
  1. 6 5
      library/Zend/Pdf/Annotation/Link.php

+ 6 - 5
library/Zend/Pdf/Annotation/Link.php

@@ -70,18 +70,19 @@ class Zend_Pdf_Annotation_Link extends Zend_Pdf_Annotation
     /**
     /**
      * Create link annotation object
      * Create link annotation object
      *
      *
-     * @param float $x1
-     * @param float $y1
-     * @param float $x2
-     * @param float $y2
+     * @param float                  $x1
+     * @param float                  $y1
+     * @param float                  $x2
+     * @param float                  $y2
      * @param Zend_Pdf_Target|string $target
      * @param Zend_Pdf_Target|string $target
      * @return Zend_Pdf_Annotation_Link
      * @return Zend_Pdf_Annotation_Link
+     * @throws Zend_Pdf_Exception
      */
      */
     public static function create($x1, $y1, $x2, $y2, $target)
     public static function create($x1, $y1, $x2, $y2, $target)
     {
     {
         if (is_string($target)) {
         if (is_string($target)) {
             require_once 'Zend/Pdf/Destination/Named.php';
             require_once 'Zend/Pdf/Destination/Named.php';
-            $destination = Zend_Pdf_Destination_Named::create($target);
+            $target = Zend_Pdf_Destination_Named::create($target);
         }
         }
         if (!$target instanceof Zend_Pdf_Target) {
         if (!$target instanceof Zend_Pdf_Target) {
             require_once 'Zend/Pdf/Exception.php';
             require_once 'Zend/Pdf/Exception.php';