XML_RPC fix to get rid of headers

From: Date: Sat, 25 May 2002 05:22:08 +0000
Subject: XML_RPC fix to get rid of headers
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-6408@lists.php.net to get a copy of this message
for some reason the xml rpc package completly failed to get rid of the headers from pear.php.net/xmlrpc.php and that broke pear remote-list while this fix is not perfect... at least it works :) regards alan Index: RPC.php =================================================================== RCS file: /repository/pear/XML_RPC/RPC.php,v retrieving revision 1.9 diff -u -b -B -r1.9 RPC.php
--- RPC.php     22 May 2002 00:23:53 -0000      1.9
+++ RPC.php     25 May 2002 05:16:57 -0000
@@ -642,8 +642,8 @@
                return $r;
        }
        // gotta get rid of headers here
-        if ((!$hdrfnd) && ereg("^(.*)\r\n\r\n",$data,$XML_RPC_xh[$parser]['ha'])) {
-            $data=ereg_replace("^.*\r\n\r\n", "", $data);
+        if ((!$hdrfnd) && preg_match("/^([^<])*/s",$data,$XML_RPC_xh[$parser]['ha'])) {
+            $data=preg_replace("/^[^<]*/s", "", $data);
            $hdrfnd=1;
        }


« previous php.pear.dev (#6408) next »