chantasaur / lightopenid

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

get_headers might return multiple Content-Type's as array #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is from the master HEAD revision.

When using "http://launchpad.net/~myusername" as my openID, I get an error:

strpos() expects parameter 1 to be string, array given

On line 00225: && strpos($headers['Content-Type'], 'application/xrds+xml') !== 
false) {

* Here's a dump of $headers['Content-Type'] when the error occurs:

Array ( [0] => text/html; charset=iso-8859-1 [1] => text/html;charset=utf-8 )

I think this might be because there is a redirection 
"http://launchpad.net/~myusername" -> "https://launchpad.net/~myusername". When 
I'm directly entering "https://launchpad.net/~myusername", it seems to work 
fine.

Does this have something to do with the redirection and cURL?

Original issue reported on code.google.com by w3b0id3@gmail.com on 25 Sep 2010 at 7:59

GoogleCodeExporter commented 8 years ago
I also get the same error using "yahoo.com" as OpenID.

Here's contents of $headers['Content-Type']:

Array ( [0] => text/html [1] => text/html; charset=utf-8 )

Original comment by w3b0id3@gmail.com on 25 Sep 2010 at 8:04

GoogleCodeExporter commented 8 years ago
Well, it's an undocumented behavior of get_headers() function.

@w3b0id3: It has nothing to do with cURL -- most recent versions use php 
streams instead of cURL, and it caused some problems.

Anyway, the bug will be fixed soon.

Original comment by mewp...@gmail.com on 25 Sep 2010 at 8:38

GoogleCodeExporter commented 8 years ago
Ok, it should work fine now.

Thanks for reporting it.

By the way, you should use "me.yahoo.com", because "yahoo.com" doesn't, and 
never will work (because it doesn't contain any discovery information).

Original comment by mewp...@gmail.com on 25 Sep 2010 at 10:23

GoogleCodeExporter commented 8 years ago
Yep, works great! Thanks.

Original comment by w3b0id3@gmail.com on 25 Sep 2010 at 11:04