Opened 13 years ago

Closed 13 years ago

#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: Browser: All
External ID: Operating System: All
state: New

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.

Change History (1)

comment:1 by madair, 13 years ago

Resolution: fixed
Status: newclosed

(In [1823]) closes #234: use built-in methods where appropriate

Note: See TracTickets for help on using tickets.