PHP-OpenID-0.0.8.1 released
ctd1500
ctd1500 at gmail.com
Wed Sep 7 10:53:08 PDT 2005
On 9/7/05, Dan Libby <danda at videntity.org> wrote:
> http://www.videntity.org/openid/
>
> Or, direct download:
> http://www.videntity.org/tp/downloads/PHP-OpenID-0.0.8.1.tar.bz2
>
> ChangeLog
>
> 2005-09-07 08:44 danda
>
> * openid/httpclient.php: add a comment about validating urls before
> fetching
>
> 2005-09-07 08:39 danda
>
> * openid/consumer.php: normalize url better, per spec and feedback
> at
> http://lists.danga.com/pipermail/yadis/2005-September/001401.html
>
> 2005-09-07 07:55 danda
>
> * examples/simple.php, openid/httpclient.php: from Martin Atkins
> mart at degeneration.co.uk
>
> Attached is a small patch containing the changes I had to make
> firstly to get it to run properly on my server here and to work
> with LiveJournal. It also features some more general fixes. In
> particular: * no SCRIPT_URI was being set on my server, so I
> added a best-guess fallback * you were sending the full URL in
> the HTTP request line rather than just the path component, which
> upset LiveJournal's mod_perl code. (Apache by default simply
> disregards the scheme and host part, but LiveJournal replaces the
> component that would normally do that and doesn't handle that
> case) * the return_url check was failing where there's no port
> number component in the URL.
>
You seem to have used non-working code, in place of the patch I sent
in yesterday.
Below is the Working patch for the new release:
--- PHP-OpenID-0.0.8.1/openid/consumer.php Tue Sep 07 10:33:55 2005
+++ PHP-OpenID-0.0.8.1/openid/consumer.php Tue Sep 07 10:38:21 2005
@@ -70,17 +70,15 @@
function normalize_url($url) {
assert( 'is_string( $url )' );
$url = trim( $url );
$parts = parse_url( $url );
$scheme = isset( $parts['scheme'] ) ? $parts['scheme'] : null;
- $path = isset( $parts['path'] ) ? $parts['path'] : null;
if( !$scheme ) {
$url = 'http://' . $url;
}
- if( !$path ) {
- $url .= '/';
- }
-
+ if (!preg_match("#(http(s)?)://.+/#is", $url)) {
+ $url .= "/";
+ }
// Porting Todo: handle unicode urls.
More information about the yadis
mailing list