ID:               33142
 User updated by:  jkump at everestgt dot com
 Reported By:      jkump at everestgt dot com
-Status:           Bogus
+Status:           Open
 Bug Type:         Session related
 Operating System: Solaris 9
 PHP Version:      5.0.4
 New Comment:

Here is the flaming script.


<?php
ini_set(display_errors, on);
session_start();

$XML='<?xml version="1.0" encoding="UTF-8"?>
      <book type="paperback">
              <title>Red Nails</title>
              <price>$12.99</price>
              <author>
                      <name> 
                        <first>Robert</first>
                        <middle>E</middle>
                        <last>Howard</last>
                      </name>
                      <birthdate>9/21/1977</birthdate>
              </author>
       </book>
    ';

$HTML_XML='&lt;?xml version="1.0"?&gt;

&lt;book type="paperback"&gt;
        &lt;title&gt;Red Nails&lt;/title&gt;

        &lt;price&gt;$12.99&lt;/price&gt;
        &lt;author&gt;
                &lt;name&gt; 
                  &lt;first&gt;Robert&lt;/first&gt; 
                  &lt;middle&gt;E&lt;/middle&gt;
                  &lt;last&gt;Howard&lt;/last&gt;
                &lt;/name&gt;
                &lt;birthdate&gt;9/21/1977&lt;/birthdate&gt;
        &lt;/author&gt;

&lt;/book&gt;
';
$InXML = simplexml_load_string($XML);

if (!isset($_REQUEST["SUBMIT"])) {
  $_SESSION["PRICE"] = $InXML->price;
}

echo "<html>\n";
echo "<head><title>Test PHP BUG 33142</title></head>\n";
echo "<body>\n";
echo "<P>XML we are using: <pre>".$HTML_XML."</pre></P>\n";
echo "<BR><BR>\n";
if (isset($_SESSION["PRICE"])) {
  echo "<P>PRICE before submit: ".$_SESSION["PRICE"]."</p>\n";
}
if (isset($_SESSION["PRICE"]) && isset($_REQUEST["SUBMIT"])) {
  echo "<P>PRICE after submit: ".$_SESSION["PRICE"]."</p>\n";
}
echo "<form action=\"".$_REQUEST["PHP_SELF"]."\" method=\"POST\">\n";
echo "<input type=\"SUBMIT\" name=\"SUBMIT\" value=\"Get Price\">\n";
echo "</form>\n";

echo "</body>\n";
echo "</html>\n";
?>


Previous Comments:
------------------------------------------------------------------------

[2005-06-11 19:50:43] [EMAIL PROTECTED]

Impossible to test without a script -> bogus.
(can not reproduce)


------------------------------------------------------------------------

[2005-06-08 20:38:45] jkump at everestgt dot com

It seems as though the simplexml_load_string object is clobbering the
Session object.

http://www.fastcarrot.net/index.php

------------------------------------------------------------------------

[2005-06-08 02:40:42] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.



------------------------------------------------------------------------

[2005-06-07 06:34:15] jkump at everestgt dot com

Please check this bug report with regard to sessions and
simplexml_load_string()

Thanks

------------------------------------------------------------------------

[2005-06-02 23:01:46] jkump at everestgt dot com

This problem occurs when simplexml_load_string is used within the
session.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/33142

-- 
Edit this bug report at http://bugs.php.net/?id=33142&edit=1

Reply via email to