drewm / hkit

Automatically exported from code.google.com/p/hkit
0 stars 0 forks source link

warnings for certain urls #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. load http://www.last.fm/user/gw with hcard profile

I get php warnings. Also, I don't think fn should be required. 
The patch I provide checks if the first hierarchy of $s is an array with
non-numeric keys (that means, processNodes only found one hcard) and wraps
it into an array, to make the formatting consistent.

on a long term processNodes should return consistent/predictable results,
i.e. the top level is always an indexed array containing all found results.

an example of the applied patch in use: 
http://web84.login-65.hoststar.ch/php_profile_import/profile_import_example.php

Original issue reported on code.google.com by uwe...@gmail.com on 21 Apr 2008 at 10:11

Attachments:

GoogleCodeExporter commented 9 years ago
I agree we should avoid PHP issuing warnings. That shouldn't happen. However, fn
fundamentally *is* required by hCard, and therefore the entire hCard should 
probably
be discarded if fn isn't found.

See: http://microformats.org/wiki/hcard#Property_List

There's work in other areas (notably the XFN integration) to unify the 
interface so
that output is predictable - we should certainly take this patch into 
consideration
for that.

Original comment by drew.mcl...@gmail.com on 21 Apr 2008 at 10:59

GoogleCodeExporter commented 9 years ago
yes, fn is required by the standard. but hkit should still not just reject such
hcards right away, it should be up to the user, or at least there should be an 
option
of strict parsing, if really necessary.

An analogy being a browser that returns a blank page if the page doesn't 
validate. 

Original comment by uwe...@gmail.com on 21 Apr 2008 at 11:06

GoogleCodeExporter commented 9 years ago
The above patch has been applied and is now in SVN. Thanks for your 
contribution.

Original comment by drew.mcl...@gmail.com on 21 Apr 2008 at 4:47