Package: libphp-jpgraph
Version: 1.5.2-10
Severity: normal
Tags: patch

Hello,

In jpgraph.php, the $gd2 variable is set, assuming that this is the
global scope. It's later read everywhere by accessing $GLOBALS['gd2'].
In our use of jpgraph, we're including it inside a specific function.
That means that the definition of $gd2 is no longer in the global scope,
and it fails to work.

The fix is simple: explicitly set $GLOBALS['gd2'] in jpgraph.php. A
patch is attached; I hope it can be included in a next release.

Thanks,
Thijs

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libphp-jpgraph depends on:
ii  php4                         4:4.3.10-16 server-side, HTML-embedded scripti
ii  php4-gd                      4:4.3.10-16 GD module for php4

-- no debconf information
--- jpgraph.php	2004-09-13 22:30:06.000000000 +0200
+++ /tmp/jpgraph.php	2006-02-27 22:10:31.458115050 +0100
@@ -253,11 +253,11 @@
 // Check what version of the GD library is being used
 //
 if(function_exists('imagecopyresampled') ) {
-    $gd2 = true;
+    $GLOBALS['gd2'] = true;
     $copyfunc = "imagecopyresampled";
 } elseif(function_exists('imagecopyresized')) {
     $copyfunc = "imagecopyresized";
-    $gd2 = false;
+    $GLOBALS['gd2'] = false;
 }
 else {
     JpGraphError::Raise("<b>JpGraph Error:</b> Your PHP installation does not 

Reply via email to