Fix: allow_call_time_pass_reference ne va plus être exploité dans php.ini

This commit is contained in:
Regis Houssin 2007-09-09 10:57:07 +00:00
parent 1a50dd475e
commit 9b2c67e6fc
4 changed files with 17 additions and 17 deletions

View File

@ -67,7 +67,7 @@
\version $Revision$ \version $Revision$
*/ */
require_once(FPDF_PATH.'fpdi_protection.php'); require_once(FPDFI_PATH.'fpdi_protection.php');
/** /**

View File

@ -29,7 +29,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require_once('PDF_card.class.php'); require_once('PDF_card.class.php');

View File

@ -29,7 +29,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require_once('PDF_card.class.php'); require_once('PDF_card.class.php');

View File

@ -80,7 +80,7 @@ class XML {
$this->parser = xml_parser_create(); $this->parser = xml_parser_create();
xml_parser_set_option ($this->parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option ($this->parser, XML_OPTION_CASE_FOLDING, 0);
xml_set_object($this->parser, &$this); xml_set_object($this->parser, $this);
xml_set_element_handler($this->parser, "open", "close"); xml_set_element_handler($this->parser, "open", "close");
xml_set_character_data_handler($this->parser, "data"); xml_set_character_data_handler($this->parser, "data");
# register_shutdown_function(array(&$this, 'destruct')); # register_shutdown_function(array(&$this, 'destruct'));
@ -133,7 +133,7 @@ class XML {
$this->parent[$key] = array(); $this->parent[$key] = array();
$this->parent = &$this->parent[$key]; $this->parent = &$this->parent[$key];
array_unshift($this->parents, &$this->parent); array_unshift($this->parents, $this->parent);
} }
function data($parser, $data){ function data($parser, $data){
@ -156,7 +156,7 @@ class XML {
function & XML_unserialize(&$xml){ function & XML_unserialize(&$xml){
$xml_parser = new XML(); $xml_parser = new XML();
$data = &$xml_parser->parse(&$xml); $data = &$xml_parser->parse($xml);
$xml_parser->destruct(); $xml_parser->destruct();
return $data; return $data;
} }
@ -165,7 +165,7 @@ function & XMLRPC_parse(&$request){
if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
XMLRPC_debug('XMLRPC_parse', "<p>Received the following raw request:</p>" . XMLRPC_show($request, 'print_r', true)); XMLRPC_debug('XMLRPC_parse', "<p>Received the following raw request:</p>" . XMLRPC_show($request, 'print_r', true));
} }
$data = &XML_unserialize(&$request); $data = &XML_unserialize($request);
if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
XMLRPC_debug('XMLRPC_parse', "<p>Returning the following parsed request:</p>" . XMLRPC_show($data, 'print_r', true)); XMLRPC_debug('XMLRPC_parse', "<p>Returning the following parsed request:</p>" . XMLRPC_show($data, 'print_r', true));
} }
@ -187,7 +187,7 @@ function & XMLRPC_prepare($data, $type = NULL){
if(array_key_exists("$n type", $data)){ if(array_key_exists("$n type", $data)){
$type = $data["$n type"]; $type = $data["$n type"];
} }
$temp[$n] = XMLRPC_prepare(&$data[$n], $type); $temp[$n] = XMLRPC_prepare($data[$n], $type);
} }
} }
}else{ #it's a struct }else{ #it's a struct
@ -202,7 +202,7 @@ function & XMLRPC_prepare($data, $type = NULL){
if(array_key_exists("$key type", $data)){ if(array_key_exists("$key type", $data)){
$type = $data["$key type"]; $type = $data["$key type"];
} }
$temp[] = array('name' => $key, 'value' => XMLRPC_prepare(&$value, $type)); $temp[] = array('name' => $key, 'value' => XMLRPC_prepare($value, $type));
} }
} }
} }
@ -244,11 +244,11 @@ function & XMLRPC_adjustValue(&$current_node){
if(is_array($temp) and array_key_exists(0, $temp)){ if(is_array($temp) and array_key_exists(0, $temp)){
$count = count($temp); $count = count($temp);
for($n=0;$n<$count;$n++){ for($n=0;$n<$count;$n++){
$temp2[$n] = &XMLRPC_adjustValue(&$temp[$n]); $temp2[$n] = &XMLRPC_adjustValue($temp[$n]);
} }
$temp = &$temp2; $temp = &$temp2;
}else{ }else{
$temp2 = &XMLRPC_adjustValue(&$temp); $temp2 = &XMLRPC_adjustValue($temp);
$temp = array(&$temp2); $temp = array(&$temp2);
#I do the temp assignment because it avoids copying, #I do the temp assignment because it avoids copying,
# since I can put a reference in the array # since I can put a reference in the array
@ -267,12 +267,12 @@ function & XMLRPC_adjustValue(&$current_node){
$count = count($temp); $count = count($temp);
for($n=0;$n<$count;$n++){ for($n=0;$n<$count;$n++){
#echo "Passing name {$temp[$n][name]}. Value is: " . show($temp[$n][value], var_dump, true) . "<br>\n"; #echo "Passing name {$temp[$n][name]}. Value is: " . show($temp[$n][value], var_dump, true) . "<br>\n";
$temp2[$temp[$n]['name']] = &XMLRPC_adjustValue(&$temp[$n]['value']); $temp2[$temp[$n]['name']] = &XMLRPC_adjustValue($temp[$n]['value']);
#echo "adjustValue(): After assigning, the value is " . show($temp2[$temp[$n]['name']], var_dump, true) . "<br>\n"; #echo "adjustValue(): After assigning, the value is " . show($temp2[$temp[$n]['name']], var_dump, true) . "<br>\n";
} }
}else{ }else{
#echo "Passing name $temp[name]<br>\n"; #echo "Passing name $temp[name]<br>\n";
$temp2[$temp['name']] = &XMLRPC_adjustValue(&$temp['value']); $temp2[$temp['name']] = &XMLRPC_adjustValue($temp['value']);
} }
$temp = &$temp2; $temp = &$temp2;
} }
@ -316,7 +316,7 @@ function XMLRPC_getParams($request){
$count = count($temp); $count = count($temp);
for($n = 0; $n < $count; $n++){ for($n = 0; $n < $count; $n++){
#echo "Serializing parameter $n<br>"; #echo "Serializing parameter $n<br>";
$temp2[$n] = &XMLRPC_adjustValue(&$temp[$n]['value']); $temp2[$n] = &XMLRPC_adjustValue($temp[$n]['value']);
} }
}else{ }else{
$temp2[0] = &XMLRPC_adjustValue($temp['value']); $temp2[0] = &XMLRPC_adjustValue($temp['value']);
@ -390,13 +390,13 @@ function XMLRPC_request($site, $location, $methodName, $params = NULL, $user_age
XMLRPC_debug('XMLRPC_request', "<p>Received the following response:</p>\n\n" . XMLRPC_show($response, 'print_r', true) . "<p>Which was serialized into the following data:</p>\n\n" . XMLRPC_show($data, 'print_r', true)); XMLRPC_debug('XMLRPC_request', "<p>Received the following response:</p>\n\n" . XMLRPC_show($response, 'print_r', true) . "<p>Which was serialized into the following data:</p>\n\n" . XMLRPC_show($data, 'print_r', true));
} }
if(isset($data['methodResponse']['fault'])){ if(isset($data['methodResponse']['fault'])){
$return = array(false, XMLRPC_adjustValue(&$data['methodResponse']['fault']['value'])); $return = array(false, XMLRPC_adjustValue($data['methodResponse']['fault']['value']));
if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
XMLRPC_debug('XMLRPC_request', "<p>Returning:</p>\n\n" . XMLRPC_show($return, 'var_dump', true)); XMLRPC_debug('XMLRPC_request', "<p>Returning:</p>\n\n" . XMLRPC_show($return, 'var_dump', true));
} }
return $return; return $return;
}else{ }else{
$return = array(true, XMLRPC_adjustValue(&$data['methodResponse']['params']['param']['value'])); $return = array(true, XMLRPC_adjustValue($data['methodResponse']['params']['param']['value']));
if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
XMLRPC_debug('XMLRPC_request', "<p>Returning:</p>\n\n" . XMLRPC_show($return, 'var_dump', true)); XMLRPC_debug('XMLRPC_request', "<p>Returning:</p>\n\n" . XMLRPC_show($return, 'var_dump', true));
} }
@ -407,7 +407,7 @@ function XMLRPC_request($site, $location, $methodName, $params = NULL, $user_age
function XMLRPC_response($return_value, $server = NULL){ function XMLRPC_response($return_value, $server = NULL){
$data["methodResponse"]["params"]["param"]["value"] = &$return_value; $data["methodResponse"]["params"]["param"]["value"] = &$return_value;
$return = XML_serialize(&$data); $return = XML_serialize($data);
if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){
XMLRPC_debug('XMLRPC_response', "<p>Received the following data to return:</p>\n\n" . XMLRPC_show($return_value, 'print_r', true)); XMLRPC_debug('XMLRPC_response', "<p>Received the following data to return:</p>\n\n" . XMLRPC_show($return_value, 'print_r', true));