[Fusioninventory-devel] Import OCS agent in plugin FusionInventory plugins (in dev now)

Gonéri Le Bouder goneri at rulezlan.org
Thu Feb 10 11:28:45 UTC 2011


2011/2/10 David DURIEUX <d.durieux at siprossii.com>

> Hello,
>
>
Linvinus pointed out some issue with the code.


> For example, I have try with RU inventory but not works with these two
> codes :
>
> if
> (strstr(gzuncompress($GLOBALS["HTTP_RAW_POST_DATA"]),'encoding="ISO-8859-1"'))
> {

  $data = gzuncompress($GLOBALS["HTTP_RAW_POST_DATA"]);
>
You call  gzuncompress two time in a row here. It's useless. For your
information, since OCS 1.02, the agent can also push uncompressed XML.

  $from_charset=mb_detect_encoding($data, "auto");
>
This will never work as expected :( The server administrator has to set
$from_charset by hisself.


>   $data = mb_convert_encoding($data,"UTF-8",$from_charset);
>   $GLOBALS["HTTP_RAW_POST_DATA"] = gzcompress($data);
>
This is not a good idea. You should never change the GLOBALS var content.

Cheers
-- 
     Gonéri Le Bouder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/fusioninventory-devel/attachments/20110210/c7d0fcf2/attachment-0001.htm>


More information about the Fusioninventory-devel mailing list