andig / carddav2fb

Download CardDAV VCards and upload as phonebook to AVM FRITZ!Box
63 stars 19 forks source link

rtrim in getvcard cripples the ID #112

Closed blacksenator closed 5 years ago

blacksenator commented 5 years ago

The rtrim command in Backend.php cripples the vCard ID (in some cases?)

Here is a quick output from echos befor and after line 193:

...
1836ACFE-3416-485B-80BC-0BEF469D8FBD.vcf
   26 [-------------------------->-]18737d82-d14e-437b-a380-597fca0ecf09 .vcf
18737d82-d14e-437b-a380-597fca0ecf09.vcf
   27 [--------------------------->]189efc8f-8294-45be-9d39-be0994410b1c .vcf
189efc8f-8294-45be-9d39-be0994410b1.vcf

In RequestException.php line 113:

  Client error: `GET https://p27-contacts.icloud.com/1019761670/carddavhome/card/189efc8f-8294-45be-9d39-be0994410b1.vcf` resulted in a `404 Not Found` response:
  Not Found

As you can see: in #27 the last char "c" vanished. What´s the reason for this line? $id = rtrim($vcard_id, $this->vcard_extension) . $this->vcard_extension; First trim right and than append the same string - doesn´t make sense to me.

andig commented 5 years ago

Does it work when you go back 1 commit?

andig commented 5 years ago

Sorry, thw last commit ws faulty, I‘ll need to undo it.

blacksenator commented 5 years ago

The 30fab4f9696378c7eac4f439f87e721ae21e784c is safe

andig commented 5 years ago

Ist behoben