Ticket #234 (closed defect: fixed)
Mapguide utility function cause LoadMap to fail
| Reported by: | beginbenoit | Owned by: | madair |
|---|---|---|---|
| Priority: | P2 | Milestone: | Future |
| Component: | MapGuide | Version: | 2.0 - beta |
| Severity: | Major | Keywords: | |
| Cc: | External ID: | ||
| state: | New | Browser: | All |
| Operating System: | All |
Description
In fusion\layers\MapGuide\php\Utility.php, the function ByteReaderToString? will cause LoadMap?.php calls to unexpectedly terminate during the building of the JSON. The code in its current state likely uses the maximum amount of memory available for the process to run and PHP throws an exception that I was unfortunately unable to trap. The function should be changed to use the built-in ToString? function of the MgByteReader?.
function ByteReaderToString($byteReader)
{
return $byteReader->ToString();
}
It would be possible to add some validation to prevent any issues, such as calling GetMimeType? to validate that the ToString? will return something that is the actual textual representation of the content held in it.
