dshanske / parse-this

Parse This Parsing Library for WordPress- Can Act as a Standalone Plugin
GNU General Public License v2.0
15 stars 3 forks source link

[author][url] should be a string, not an array #45

Open jackjamieson2 opened 5 years ago

jackjamieson2 commented 5 years ago

As discussed in IRC today (https://chat.indieweb.org/dev/2019-06-21#t1561133036384300)

Sometimes the h-card for item authors includes url as an array with one item e.g.

         "author":{
            "note":"Hi, I'm Aaron Parecki, co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and am the editor of several W3C specifications. I record videos for local conferences and help run a podcast studio in Portland.\nI wrote 100 songs in 100 days! I've been tracking my location since 2008, and write down everything I eat and drink. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.",
            "name":"Aaron Parecki",
            "street-address":"818 SW 3rd Ave #437",
            "locality":"Portland",
            "region":"Oregon",
            "country-name":"USA",
            "postal-code":"97204",
            "callsign":"W7APK",
            "url":[
               "https:\/\/aaronparecki.com\/"
            ],
            "uid":"https:\/\/aaronparecki.com\/",
            "photo":"https:\/\/aaronparecki.com\/images\/profile.jpg",
            "bday":"--12-28",
            "org":{
               "photo":"https:\/\/aaronparecki.com\/images\/backpedal.png",
               "url":"https:\/\/backpedal.tv",
               "name":"backpedal.tv",
               "type":"card"
            },
            "type":"card"
         },

I've only noticed this directly with the microformats feed from aaronparecki.com/syndicated, but it probably occurs elsewhere as well.

Potentially related, when parsing this feed I also got a php warning:

Notice: Undefined index: author in /home4/karmaco1/public_html/microsub-dev/wp-content/plugins/yarns-microsub-server/vendor/parse-this/includes/class-parse-this-mf2.php on line 665

dshanske commented 5 years ago

Fixed the error, but the array I can't figure out yet.

dshanske commented 4 years ago

@jackjamieson2 Can you check this one again?

jackjamieson2 commented 4 years ago

Thanks @dshanske. Just replying to let you know this is on my to-do list, so I'll try to get to it soon