php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28440 unparsed code dumped
Submitted: 2004-05-19 02:35 UTC Modified: 2004-05-19 02:58 UTC
From: michael at mompopmedia dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.0.0RC2 OS: redhat 9
Private report: No CVE-ID: None
 [2004-05-19 02:35 UTC] michael at mompopmedia dot com
Description:
------------
When I change a script, php parses and output the expected results, but also outputs unparsed code.  The unparsed code that gets outputed to the browser is either a portion of the code from the current script, or (strangely) a portion of the code from a previously saved version of the script.

My build is as follows:

System 	Linux kc.node1.com 2.4.20-30.9smp #1 SMP Wed Feb 4 20:36:46 EST 2004 i686
Build Date 	Apr 29 2004 15:32:32
Configure Command 	'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--enable-wddx' '--with-xmlrpc' '--with-zlib' '--enable-simplexml' '--enable-soap'
Server API 	Apache
Virtual Directory Support 	disabled
Configuration File (php.ini) Path 	/usr/local/lib/php.ini
PHP API 	20031224
PHP Extension 	20040412
Zend Extension 	220040412
Debug Build 	no
Thread Safety 	disabled
IPv6 Support 	enabled
Registered PHP Streams 	php, file, http, ftp, compress.zlib, https, ftps
Registered Stream Socket Transports 	tcp, udp, unix, udg, ssl, tls

Server Version: Apache/1.3.29 (Unix) PHP/5.0.0RC2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16 OpenSSL/0.9.7a
Server Built: Apr 29 2004 14:52:49

Reproduce code:
---------------
code was:

<?php

set_include_path('/home/vendors/ims_gateway/lib:'.get_include_path());
include('XML/RPC/Server.php');

function server($msg) {
    include('Var_Dump.php');
    $dump = new Var_Dump();
    $out = $dump->r_display($msg);
    file_put_contents('server.html', $out);
    
    return new XML_RPC_Response(true);
}

$map = array("server" => 
            array("function" => 'server',
                    "signature" => array(array("int", "string", "string")),
                    "docstring" => "Some docs"));
                    
$server = new XML_RPC_Server($map);

?>

then changed to:


<?php

phpinfo();

?>

Expected result:
----------------
regular phpinfo() output

Actual result:
--------------
...
lots of phpinfo() output followed by unparsed garbage
....
</tbody></table><br>
</div>th('/home/vendors/ims_gateway/lib:'.get_include_path());
include('XML/RPC/Server.php');

function server($msg) {
    include('Var_Dump.php');
    $dump = new Var_Dump();
    $out = $dump-&gt;r_display($msg);
    file_put_contents('server.html', $out);
    
    return new XML_RPC_Response(true);
}

$map = array("server" =&gt; 
            array("function" =&gt; 'server',
                    "signature" =&gt; array(array("int", "string", "string")),
                    "docstring" =&gt; "Some docs"));
                    
$server = new XML_RPC_Server($map);

?&gt;</body></html>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-19 02:58 UTC] michael at mompopmedia dot com
man, scratch that.  been testing out the latest Zend development environment.  For some strange reason it is not completely writing over files when it saves to the server -- thus the unparsed code that falls below the (shorter) overwritten code.

Sorry! shoudl have checked that out first before freakin!


eg:

<?php
set_include_path('/home/vendors/ims_gateway/lib:'.get_include_path()
require_once('XML/RPC.php');

$v1 = new XML_RPC_Value("mike", "string");
$v2 = new XML_RPC_Value("caplan", "string");
$params = array($v1, $v2);

$message = new XML_RPC_Message("server", $params);

$client = new XML_RPC_Client("/server.php", "vendorsondemand.com", 8
$result = $client->send($message);


echo "<p><b>Sent XML Message:</b>" .
"<pre>" . htmlentities($message->serialize()). "</pre></p>";

echo "<p><b>Return Value:</b> $number </p>";
echo "<p><b>Received XML Message:</b>" .
"<pre>" . htmlentities($result->serialize()) . "</pre></p>";

?>ML Message:</b>" .
       "<pre>" . htmlentities($result->serialize()) . "</pre></p>";

?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 05 00:01:27 2024 UTC