[freeside-commits] freeside/fs_selfservice/drupal freeside.class.php, 1.1, 1.1.2.1
Mark Wells
mark at wavetail.420.am
Thu May 12 15:14:15 PDT 2011
Update of /home/cvs/cvsroot/freeside/fs_selfservice/drupal
In directory wavetail.420.am:/tmp/cvs-serv8516
Modified Files:
Tag: FREESIDE_2_1_BRANCH
freeside.class.php
Log Message:
fix Drupal argument passing, #9380
Index: freeside.class.php
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/drupal/freeside.class.php,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -w -d -r1.1 -r1.1.2.1
--- freeside.class.php 12 Aug 2010 21:31:19 -0000 1.1
+++ freeside.class.php 12 May 2011 22:14:13 -0000 1.1.2.1
@@ -1,5 +1,14 @@
<?php
+function flatten($hash) {
+ if ( !is_array($hash) ) return $hash;
+ $flat = array();
+ array_walk($hash, function($value, $key, &$to) {
+ array_push($to, $key, $value);
+ }, &$flat);
+ return($flat);
+}
+
class FreesideSelfService {
public $URL = '';
@@ -11,8 +20,9 @@
public function __call($name, $arguments) {
error_log("[FreesideSelfService] $name called, sending to ". $this->URL);
-
- $request = xmlrpc_encode_request("FS.ClientAPI_XMLRPC.$name", $arguments);
+ $request = xmlrpc_encode_request("FS.ClientAPI_XMLRPC.$name",
+ flatten($arguments[0])
+ );
$context = stream_context_create( array( 'http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml",
More information about the freeside-commits
mailing list