Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue With Event Descriptions Containing Line Breaks #2

Open
cooperfellows opened this issue Mar 30, 2016 · 0 comments
Open

Issue With Event Descriptions Containing Line Breaks #2

cooperfellows opened this issue Mar 30, 2016 · 0 comments

Comments

@cooperfellows
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant