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

a lot of errors, but i seems to work... (php7) #24

Open
DjSni opened this issue Jan 26, 2018 · 3 comments
Open

a lot of errors, but i seems to work... (php7) #24

DjSni opened this issue Jan 26, 2018 · 3 comments

Comments

@DjSni
Copy link

DjSni commented Jan 26, 2018

carddav2fb.php 1.11 (2016-05-12) - CardDAV to FRITZ!Box phonebook conversion tool
Copyright (c) 2012-2016 Karl Glatz, Martin Rost, Jens Maus, Johannes Freiburger

Retrieving VCards from all CardDAV server(s):
[0]: https://carddav.fastmail.com/dav/addressbooks/user/xxxx/Default/ .................................................................................................................................................................................... 180 VCards retrieved.
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
WARNING: No fullname, lastname, orgname or formatted name found!
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320
Done.
Converting VCards to FritzBox XML format:
WARNING: Only VCard embedded photo data or a reference URL is currently supported.
VCard: 'UNKNOWN'
WARNING: no phone entry found. VCard will be ignored.
VCard: 'UNKNOWN'
WARNING: no phone entry found. VCard will be ignored.
VCard: 'xxx'
WARNING: Only VCard embedded photo data or a reference URL is currently supported.
[....]
Done.
Upload data to FRITZ!Box @ 192.168.x.x
Uploading Phonebook XML to 192.168.x.x
FRITZ!Box returned message: 'FRITZ!Box Telefonbuch wiederhergestellt'
Done.

@DjSni DjSni changed the title a lot of errors, but i seems to work... a lot of errors, but i seems to work... (php7) Jan 26, 2018
@DjSni
Copy link
Author

DjSni commented Jan 26, 2018

php -v
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )

@j-ed
Copy link

j-ed commented May 6, 2019

PHP Warning: Illegal string offset 'value' in /opt/carddav2fb/lib/vCard-parser/vCard.php on line 320

I had run into that error too, with PHP 7.2.14 and tried to find the root cause of the problem. I found out that the expected record structure looks like this:

Array
(
    [0] => Array
        (
            [value] => /9j/4AAQSkZJRgAB...
            [type] => Array
                (
                    [0] => jpeg
                )

            [encoding] => b
        )
)

Unfortunately the record structure changes some time so that the mentioned warning is displayed:

Array
( 
    [0] => data:image/jpeg;base64,/9j/4AAQSkZJR...
)

I didn't investigate why the record structure is changing but I was able to suppress the message by adding two additional checks to the code:

  1. I added a check if $V is an array or not.
  2. I added a check if the array key 'value' exists.
# diff -rupN vCard.php.ORG vCard.php
--- vCard.php.ORG       2019-05-06 12:45:31.805348829 +0200
+++ vCard.php   2019-05-06 19:20:47.970866487 +0200
@@ -317,11 +317,17 @@
                                        $Value = $this -> Data[$Key];
                                        foreach ($Value as $K => $V)
                                        {
-                                               if (stripos($V['value'], 'uri:') === 0)
-                                               {
-                                                       $Value[$K]['value'] = substr($V, 4);
-                                                       $Value[$K]['encoding'] = 'uri';
-                                               }
+                        if (is_array($V))
+                        {
+                            if (array_key_exists('value', $V))
+                            {
+                                if (stripos($V['value'], 'uri:') === 0)
+                                {
+                                    $Value[$K]['value'] = substr($V, 4);
+                                    $Value[$K]['encoding'] = 'uri';
+                                }
+                            }
+                        }
                                        }
                                        return $Value;
                                }

I hope this will help someone else too, to get rid of the messages.

@carlos22
Copy link
Owner

You might look at #34.

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

3 participants