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

Fixed a bug where some RETS images couldn't be fetched #323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Parsers/GetObject/Multiple.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public function parse(PHRETSResponse $response)
// make the last one look like the rest for easier parsing
$body = preg_replace('/\r\n--' . $boundary . '--/', "\r\n--{$boundary}\r\n", $body);

// Create a regular expression pattern to match the description: field and its value
$fieldToUpdate = 'Description';
$pattern = "/{$fieldToUpdate}:(.*?)(\r?\n\r?\n|$)/si";
// remove the value until an empty line is reached because Guzzle is not able to parse if the value is in multilines
$body = preg_replace($pattern, "{$fieldToUpdate}:\r\n\r\n", $body);

// cut up the message
$multi_parts = explode("\r\n--{$boundary}\r\n", $body);
// take off anything that happens before the first boundary (the preamble)
Expand Down