If I have some time, I would try to convert the functions to 
directly access the global variables using, e.g.:

 $GLOBALS['_xmlrpcs_listMethods_doc'];

This makes the code a little messier perhaps, but lends itself
to further security measures for POSTed vs. other global data.
We are using this method now in phpgroupware without any negative
impact on php3 or 4, with or without register_globals = on in
the php.ini.

Nicolay Mausz wrote:
> 
> Hi,
> 
> Several months ago (in february) I asked for adding global statements
> (see below for info). I downloaded now the new version 1.01 but it seems
> that this problem already exists.
> Below is my global list for an old XML-RPC version. It would be great if
> someone can add this to the current distribution.
> 
> Thanks!
> 
> Nicolay
> 
> // $Id: xmlrpcs.inc,v 1.5 2000/06/03 13:44:33 edmundd Exp $
> 
> global $_xmlrpcs_listMethods_sig;
> 
> global $_xmlrpcs_listMethods_doc;
> global $_xmlrpcs_methodSignature_sig;
> global $_xmlrpcs_methodSignature_doc;
> global $_xmlrpcs_dmap;
> global $_xmlrpc_debuginfo;
> 
> ------------------
> // $Id: xmlrpc.inc,v 1.7 2000/08/26 18:22:28 edmundd Exp $
> 
> global
> 
>$xmlrpcI4,$xmlrpcInt,$xmlrpcDouble,$xmlrpcString,$xmlrpcDateTime,$xmlrpcBase64,$xmlrpcArray,$xmlrpcStruct;
> global $xmlrpcerr,$xmlrpcstr;
> global $xmlrpc_defencoding;
> global $xmlrpcerruser;
> global $xmlrpcerrxml;
> global $xmlrpc_backslash;
> global $xmlrpc_twoslash;
> global $xmlrpc_twoslash;
> global $_xh;
> ---------------------------------------------------------------------------------
> 
> today I had big trouble using XML-RPC. After a long search in my code I
> found the problem in the XML-RPC classes/include files. We often have
> code that includes the classes inside a function:
> class xy{
>   function myfunc() {
>         include_once "xmlrpc.inc";
>         ...
>   }
> }
> We have got sveral layers of these nested constructs because it is a
> very big software project.
> 
> But the XML-RPC classes uses global variables - e.g. $xmlrpcTypes. These
> variables are not visible in global (they are included in another
> function => they are local variables in that function).
> 
> As a workaround I put a big global list at the beginning of each XML-RPC
> file:
> global $xmlrpcTypes,$xmlEntities,... etc.
> Another solution would be a global defined object with all these
> variables as members.
> 
> It would be great if these changes could be made in the main
> distribution.
> 
> --
> For information about how to subscribe and unsubscribe from this list
> visit http://xmlrpc.usefulinc.com/list.html

-- 

Miles Lott - http://milosch.net
Handspring Visor USB and BeOS FS support for Linux
phpGroupWare - http://www.phpgroupware.org

--
For information about how to subscribe and unsubscribe from this list
visit http://xmlrpc.usefulinc.com/list.html

Reply via email to