PHRETS
PHRETS copied to clipboard
Xml parse exception
An old closed issue still valid and I've figured out the problem. here is the issue I'm talking about: https://github.com/troydavisson/PHRETS/issues/73
WARNING:
- I've fix it with 2 required php extensions. iconv and mbstring so if you release this fix I think we should have a major release to make sure people using composer will not get problems if they do not have those extensions installed.
The issue is releated to the fact some of the providers do not return the data properly and the xml is not valid.
1- the Windows/Linux issue is probably related to the ^M that appear at the end of each lines (Windows char). I've got this crap from the mlslistings rets server response. 2- I've also receive non UTF-8 char into the xml from the mlslisting server. ex: The copy right sigh that they didn't html entity.
I've test this fix with those rets servers: rebny, mlspin, gamls, fmls and mlslistings
You can test before applying the patch and after with this xml response string that came from the mlslistings rets where the sign ® cause the issue:
<RETS ReplyCode="0" ReplyText="Operation Successful"> <COUNT Records="1" /> <DELIMITER value="09" /> <COLUMNS> NRDSID PrimaryPhone AddressMailingCareOf OldOfficeID AddressMailingPostalCode AddressCityID AddressCareOf IDXYN Aggregation LongName MLS AddressLine1 CorporateLicense MasterOfficeID AddressMailingCounty Status FaxNumber NoOfBranches AddressMailing AddressStreetSuffix OfficeName VOW StateID DesignatedBroker AddressLine2 OtherPhone ContactMember OfficeID AddressMailingStateID AddressCityName BranchNumber Zip AddressStreetName BrokerCode AddressStateCode AddressMailingCityID Type MainOfficeID BrokerAgentID URL EmailAddress OldLastModDt BoardID LastModDt BranchType </COLUMNS> <DATA> 60842 (916) 929-4706 Roger Hackney, REALTOR® 877723528 95825 235 1 Quattro Roger Hackney MetroList 333 University Ave #200 00834701 877723528 Active (916) 929-6531 0 333 University Ave #200 Roger Hackney 5 44353 4592 5 1 95825 01RHCI 235 Real Estate Office / MLS 4592 44353 http://www.campuscommons.net [email protected] 2018-07-09T15:22:45 MetroList 2018-07-09T15:28:44 Single/Standalone </DATA> <MAXROWS /> <RETS-STATUS ReplyCode="0" ReplyText="Operation Successful" /> </RETS>