AdobeConnect-php-api-client icon indicating copy to clipboard operation
AdobeConnect-php-api-client copied to clipboard

Issue With Event Descriptions Containing Line Breaks

Open cooperfellows opened this issue 8 years ago • 0 comments

First off, thanks for a nice library to make working with this API easier.

I've run into an issue when events have line breaks in their descriptions. The way you are grabbing the XML data out of the response code is by exploding the response on two line breaks:

$temp = explode("\r\n\r\n", $response);

This works great on most responses, as the content of the information comes after two line breaks following the date:

HTTP/1.1

200 OK Server: Apache-Coyote/1.1 Set-Cookie: BREEZESESSION=xxxxxxxxxxxxxxxx;HttpOnly;domain=.adobeconnect.com;secure;path=/ Cache-Control: max-age:5 Expires: now Content-Type: text/xml Content-Length: 3682 Date: Wed, 30 Mar 2016 16:22:54 GMT

Completed/123456abcde/2015-04-30T12:33:45.810-04:00

However, this is not always the only place where two line breaks could occur, so the possibility exists that you could wind up with multiple results in the array, so you can't rely on using $temp[1].

You can get around this issue by prepending your explode string with 'GMT', as that is always present prior to the line breaks:

$temp = explode("GMT\r\n\r\n", $response);

It's been working in my testing so far, but please, feel free to suggest an alternate solution.

Thanks again.

cooperfellows avatar Mar 30 '16 16:03 cooperfellows