Page 1 of 1

gzuncompress

Posted: Mon 22. Jan 2007, 17:06
by susscorfa
hi

i'm having a problem with the map cnt part when i click open map in the admin i get the folowing error message

Warning: gzuncompress() [function.gzuncompress]: data error in /**cut**/www/include/inc_tmpl/content/cnt51.open.php on line 42


that is produces by the following code does any one know a solution to the problem

Code: Select all

<?php

//include('../../inc_conf/conf.inc.php');
include('../../../config/phpwcms/conf.inc.php');
$img = rawurlencode('../../../'.$phpwcms["templates"].'/inc_cntpart/map/map_img/'.$_GET['map']);
$map = '';
$p = array();

if(isset($_GET['points'])) {
        $points = explode(':|:', gzuncompress(base64_decode($_GET['points'])));
        if(count($points)) {
                foreach($points as $value) {
                        $point = explode(':::', $value);
                        $map .= '<area shape="rect" coords="'.($point[0]-3).','.($point[1]-3);
                        $map .= ','.($point[0]+4).','.($point[1]+4).'" href="#" title="';
                        $map .= $point[2]."\">\n";
                        $p[] = $point[0].'x'.$point[1];

Posted: Wed 24. Jan 2007, 16:14
by Will
Hello,

I'm having the very same problem... I think it is that the variable $_GET['points'] is empty or sort of.

Anyone knows a way to solve this?

All best,
Will

Posted: Wed 24. Jan 2007, 17:14
by susscorfa
i looked at that but the variable is not empty if i do a vardump of it

bart

Posted: Wed 24. Jan 2007, 18:50
by DeXXus
Will wrote:Anyone knows a way to solve this?

All best,
Will
Maybe you could temporarily turn on all PHP errors and notices and retry. Maybe something will be reported? The gzuncompress() requires the input parameter to be a string compressed with gzcompress() which is done here:
"cnt51.inc.php"

Code: Select all

echo '&points='.base64_encode(gzcompress(implode(':|:', $map_xy)));
Garbage In ~might equal~ Garbage Out ( in other words...proper Extraction requires proper Compression )

Code: Select all

string gzuncompress ( string data [, int length])
This function takes data compressed by gzcompress() and returns the original uncompressed data or FALSE on error. The function will return an error if the uncompressed data is more than 256 times the length of the compressed input data or more than the optional parameter length.


Just a thought!