Anonymous | Login | Signup for a new account | 12-17-2024 08:35 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0001397 | [Quercus] | minor | always | 10-09-06 17:38 | 01-04-07 13:58 | ||||
Reporter | dberry | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.0.21 | ||||||
Summary | 0001397: Putting intval() around a SimpleXMLElement node returns a '1' | ||||||||
Description | Converting a numeric xml element using intval() causes the value to become 1. | ||||||||
Additional Information |
<?php // This is a test to find out what is causing problems with the xmldata ?> <html> <head> </head> <body> <?php $xml = simplexml_load_file("http://localhost:8080/platform/BadEmptyElement.xml"); [^] echo(" ============================== Test 1 ================================== "); foreach ($xml->events->event as $event) { syslog(LOG_ERR,"=================With intval() ==========================="); syslog(LOG_ERR,"key_event_id=<".intval($event->key_event_id[0]).">"); syslog(LOG_ERR,"event_owner=<".intval($event->event_owner[0]).">"); syslog(LOG_ERR,"event_type=<". intval($event->event_type[0]).">"); echo(" =================With intval() =========================== "); echo("key_event_id=<". intval($event->key_event_id[0])."> "); echo("event_owner=<". intval($event->event_owner[0])."> "); echo("event_type=<". intval($event->event_type[0])."> "); syslog(LOG_ERR,"=================Without intval() ==========================="); syslog(LOG_ERR,"key_event_id=<".$event->key_event_id[0].">"); syslog(LOG_ERR,"event_owner=<".$event->event_owner[0].">"); syslog(LOG_ERR,"event_type=<". $event->event_type[0].">"); echo("=================Without intval() =========================== "); echo("key_event_id=<". $event->key_event_id[0]."> "); echo("event_owner=<". $event->event_owner[0]."> "); echo("event_type=<". $event->event_type[0]."> "); } /* echo(" =========================== Test 2 ============================= "); $xml2 = simplexml_load_file("http://localhost:8080/platform/BadCDATAElement.xml"); [^] foreach ($xml2->events->event as $event2) { echo("key_event_id=<". $event2->key_event_id."> "); echo("event_name=<". $event2->event_name."> "); echo("event_owner=<". $event2->event_owner."> "); echo("event_type=<". $event2->event_type."> "); echo("event_description=<".$event2->event_description."> "); echo("event_geographic_area=<". $event2->event_geographic_area."> "); echo("event_dcreated=<". $event2->event_dcreated."> "); echo("event_dstarted=<". $event2->event_dstarted."> "); echo("event_dstopped=<". $event2->event_dstopped."> "); echo("event_resource_accepted=<". $event2->event_resource_accepted."> "); echo("event_facility=<". $event2->event_facility."> "); } */ ?> </body> </html> |
||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed. 27 unique queries executed. |