Zend_OpenID selfUrl bug?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Zend_OpenID selfUrl bug?

Eric Coleman-3
First issue, kinda minor.  Thee second parameter to  
Zend_OpenId_Consumer->login() doesn't deal with the leading slash  
properly as far as I can tell.

If you pass '/auth/login' it will redirect to the proper url, however  
if you place 'auth/login' in the field, it goes to '//auth/login'

Second issue,

I'm pretty sure this is a bug, but the way Zend_OpenId::selfUrl()  
works, seems to -not- work with any redirected urls..

PHP_SELF and the SCRIPT_NAME + PATH_INFO params produce the following  
on a ZF application with MVC components in use:

/index.php/openid/consume

Which, should actually be /openid/consume

I ended up using REDIRECT_URL to fix it, however, I'm not sure what  
would occur outside of apache..

@@ -118,6 +118,8 @@
          $url .= $port;
          if (isset($_SERVER['SCRIPT_URL'])) {
              $url .= $_SERVER['SCRIPT_URL'];
+        } else if (isset($_SERVER['REDIRECT_URL'])) {
+            $url .= $_SERVER['REDIRECT_URL'];
          } else if (isset($_SERVER['PHP_SELF'])) {
              $url .= $_SERVER['PHP_SELF'];
          } else if (isset($_SERVER['SCRIPT_NAME'])) {



Regards,
Eric
Reply | Threaded
Open this post in threaded view
|

Re: Zend_OpenID selfUrl bug?

Dmitry Stogov
Hi Eric,

Thank you for your patch. I've just committed it.
I also fixed a bug in absoluteUrl() which caused the first issue.

Thanks. Dmitry.

Eric Coleman wrote:

> First issue, kinda minor.  Thee second parameter to
> Zend_OpenId_Consumer->login() doesn't deal with the leading slash
> properly as far as I can tell.
>
> If you pass '/auth/login' it will redirect to the proper url, however if
> you place 'auth/login' in the field, it goes to '//auth/login'
>
> Second issue,
>
> I'm pretty sure this is a bug, but the way Zend_OpenId::selfUrl() works,
> seems to -not- work with any redirected urls..
>
> PHP_SELF and the SCRIPT_NAME + PATH_INFO params produce the following on
> a ZF application with MVC components in use:
>
> /index.php/openid/consume
>
> Which, should actually be /openid/consume
>
> I ended up using REDIRECT_URL to fix it, however, I'm not sure what
> would occur outside of apache..
>
> @@ -118,6 +118,8 @@
>          $url .= $port;
>          if (isset($_SERVER['SCRIPT_URL'])) {
>              $url .= $_SERVER['SCRIPT_URL'];
> +        } else if (isset($_SERVER['REDIRECT_URL'])) {
> +            $url .= $_SERVER['REDIRECT_URL'];
>          } else if (isset($_SERVER['PHP_SELF'])) {
>              $url .= $_SERVER['PHP_SELF'];
>          } else if (isset($_SERVER['SCRIPT_NAME'])) {
>
>
>
> Regards,
> Eric
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Zend_OpenID selfUrl bug?

help_poor
Hello Eric/Dimitry,

Is ZF openid working for you ? Did you made it yet ??? Or its better use regular PHP, because i am not getting confident starting my project with it, none example exist and everybody seems no positive on this yet


Thanks