[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.117.230.198: ~ $
<?PHP
/**
 * This example shows different methods how
 * XML_Unserializer can be used to create data structures
 * from XML documents.
 *
 * @author  Stephan Schmidt <schst@php.net>
 */
error_reporting(E_ALL);

// this is a simple XML document
$xml = '<users>' .
       '  <user handle="schst">Stephan Schmidt</user>' .
       '  <user handle="mj">Martin Jansen</user>' .
       '  <group name="qa">PEAR QA Team</group>' .
       '  <foo id="test">This is handled by the default keyAttribute</foo>' .
       '  <foo id="test2">Another foo tag</foo>' .
       '</users>';

require_once 'XML/Unserializer.php';

// complex structures are arrays, the key is the attribute 'handle' or 'name', if handle is not present
$options = array(
                 XML_UNSERIALIZER_OPTION_COMPLEXTYPE => 'array',
                 XML_UNSERIALIZER_OPTION_ATTRIBUTE_KEY => array(
                                                                  'user'     => 'handle',
                                                                  'group'    => 'name',
                                                                  '#default' => 'id'
                                                                )
                );

//  be careful to always use the ampersand in front of the new operator 
$unserializer = &new XML_Unserializer($options);

// userialize the document
$status = $unserializer->unserialize($xml, false);    

if (PEAR::isError($status)) {
    echo 'Error: ' . $status->getMessage();
} else {
    $data = $unserializer->getUnserializedData();
    echo '<pre>';
    print_r($data);
    echo '</pre>';
}


// unserialize it again and change the complexType option
// but leave other options untouched
// now complex types will be an object, and the property name will be in the
// attribute 'handle'
$status = $unserializer->unserialize($xml, false, array(XML_UNSERIALIZER_OPTION_COMPLEXTYPE => 'object'));

if (PEAR::isError($status)) {
    echo 'Error: ' . $status->getMessage();
} else {
    $data = $unserializer->getUnserializedData();
    echo '<pre>';
    print_r($data);
    echo '</pre>';
}

// unserialize it again and change the complexType option
// and reset all other options
// Now, there's no key so the tags are stored in an array
$status = $unserializer->unserialize($xml, false, array(XML_UNSERIALIZER_OPTION_OVERRIDE_OPTIONS => true, XML_UNSERIALIZER_OPTION_COMPLEXTYPE => 'object'));    

if (PEAR::isError($status)) {
    echo 'Error: ' . $status->getMessage();
} else {
    $data = $unserializer->getUnserializedData();
    echo '<pre>';
    print_r($data);
    echo '</pre>';
}
?>

Filemanager

Name Type Size Permission Actions
Serializer_Bug7112.php File 724 B 0644
example.xml File 82 B 0644
serializeAndEncode.php File 1.42 KB 0644
serializeAndReturn.php File 609 B 0644
serializeCData.php File 838 B 0644
serializeIndexedArray.php File 2.49 KB 0644
serializeIndexedArrayWithContext.php File 1.01 KB 0644
serializeNullProperties.php File 1.34 KB 0644
serializeObject.php File 1.29 KB 0644
serializeRDF.php File 3.02 KB 0644
serializeSelectiveAttributes.php File 1.6 KB 0644
serializeWithAttributes.php File 1.16 KB 0644
serializeWithAttributes2.php File 1.33 KB 0644
serializeWithComment.php File 974 B 0644
serializeWithDtd.php File 925 B 0644
serializeWithIndentedAttributes.php File 1.43 KB 0644
serializeWithNamespace.php File 1.05 KB 0644
serializeWithTagMap.php File 2.7 KB 0644
unserializeAnyXML.php File 2.55 KB 0644
unserializeClassNames.php File 1.19 KB 0644
unserializeEncoded.php File 949 B 0644
unserializeEnum.php File 1.16 KB 0644
unserializeObject.php File 1.44 KB 0644
unserializeRDF.php File 2.08 KB 0644
unserializeWhitespace.php File 1.09 KB 0644
unserializeWithAttributes.php File 796 B 0644
unserializeWithTagMap.php File 1.62 KB 0644
unserializeWithTypeGuessing.php File 950 B 0644