PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_DIME » Bug #5537

Use of undefined constant DIME_OTPS_LEN

Details

Submitted2005-09-27 14:49 UTC
Fromjcuenca at infocasa dot com
Assignedyunosh
StatusClosed
PackageNet_DIME
PHP Version5.0.5
OSwindows 2000
Roadmaps(Not assigned)

Comments

[2005-09-27 14:49 UTC] jcuenca at infocasa dot com

Description:
------------
Use of undefined constant DIME_OTPS_LEN - assumed 'DIME_OTPS_LEN

Test script:
---------------
$test=' a dime message ';
$f = fopen('tmp/dime2.jpg','wb+');
$debug = FALSE;
$data = NULL;
$dime = new Net_DIME_Message($f,50000,$debug);
$test = $dime->decodeData($test);
fclose($f);

Expected result:
----------------
an image in the file /tmp/dime2.jpg

Actual result:
--------------
nothing

[2006-04-18 18:09 UTC] aarondoom at cookiedoom dot com

An easy fix.

--- ../Test/includes/Net/DIME.php 2006-04-18 11:01:28.000000000 -0700
+++ includes/Net/DIME.php 2005-05-24 15:05:46.000000000 -0700
@@ -290,7 +290,7 @@ class Net_DIME_Record extends PEAR
if (!$this->_haveOpts) {
$have = strlen($this->Elements[NET_DIME_OPTS]);
$this->Elements[NET_DIME_OPTS] .= substr($data,$p,$this->Elements[NET_DIME_OPTS_LEN]-$have);
- $this->_haveOpts = (strlen($this->Elements[NET_DIME_OPTS]) == $this->Elements[NET_DIME_OPTS_LEN]);
+ $this->_haveOpts = (strlen($this->Elements[NET_DIME_OPTS]) == $this->Elements[DIME_OTPS_LEN]);
if (!$this->_haveOpts) return NULL;
$p += $this->OPTS_LENGTH-$have;
}