equal
deleted
inserted
replaced
13 * obtain it through the world-wide-web, please send an email |
13 * obtain it through the world-wide-web, please send an email |
14 * to license@zend.com so we can send you a copy immediately. |
14 * to license@zend.com so we can send you a copy immediately. |
15 * |
15 * |
16 * @category Zend |
16 * @category Zend |
17 * @package Zend_OpenId |
17 * @package Zend_OpenId |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: OpenId.php 22653 2010-07-22 18:41:39Z mabe $ |
20 * @version $Id: OpenId.php 24842 2012-05-31 18:31:28Z rob $ |
21 */ |
21 */ |
22 |
22 |
23 /** |
23 /** |
24 * @see Zend_Controller_Response_Abstract |
24 * @see Zend_Controller_Response_Abstract |
25 */ |
25 */ |
33 * Consumer and Provider. They include functions for Diffie-Hellman keys |
33 * Consumer and Provider. They include functions for Diffie-Hellman keys |
34 * generation and exchange, URL normalization, HTTP redirection and some others. |
34 * generation and exchange, URL normalization, HTTP redirection and some others. |
35 * |
35 * |
36 * @category Zend |
36 * @category Zend |
37 * @package Zend_OpenId |
37 * @package Zend_OpenId |
38 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
38 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
39 * @license http://framework.zend.com/license/new-bsd New BSD License |
39 * @license http://framework.zend.com/license/new-bsd New BSD License |
40 */ |
40 */ |
41 class Zend_OpenId |
41 class Zend_OpenId |
42 { |
42 { |
43 /** |
43 /** |
122 $port = ''; |
122 $port = ''; |
123 } |
123 } |
124 } |
124 } |
125 |
125 |
126 $url .= $port; |
126 $url .= $port; |
127 if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { |
127 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { |
|
128 // IIS with Microsoft Rewrite Module |
|
129 $url .= $_SERVER['HTTP_X_ORIGINAL_URL']; |
|
130 } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { |
|
131 // IIS with ISAPI_Rewrite |
128 $url .= $_SERVER['HTTP_X_REWRITE_URL']; |
132 $url .= $_SERVER['HTTP_X_REWRITE_URL']; |
129 } elseif (isset($_SERVER['REQUEST_URI'])) { |
133 } elseif (isset($_SERVER['REQUEST_URI'])) { |
130 $query = strpos($_SERVER['REQUEST_URI'], '?'); |
134 $query = strpos($_SERVER['REQUEST_URI'], '?'); |
131 if ($query === false) { |
135 if ($query === false) { |
132 $url .= $_SERVER['REQUEST_URI']; |
136 $url .= $_SERVER['REQUEST_URI']; |
283 $auth = $reg[2]; |
287 $auth = $reg[2]; |
284 $host = $reg[3]; |
288 $host = $reg[3]; |
285 $port = $reg[4]; |
289 $port = $reg[4]; |
286 $path = $reg[5]; |
290 $path = $reg[5]; |
287 $query = $reg[6]; |
291 $query = $reg[6]; |
288 $fragment = $reg[7]; /* strip it */ |
292 $fragment = $reg[7]; /* strip it */ /* ZF-4358 Fragment retained under OpenID 2.0 */ |
289 |
293 |
290 if (empty($scheme) || empty($host)) { |
294 if (empty($scheme) || empty($host)) { |
291 return false; |
295 return false; |
292 } |
296 } |
293 |
297 |
348 . '://' |
352 . '://' |
349 . $auth |
353 . $auth |
350 . $host |
354 . $host |
351 . (empty($port) ? '' : (':' . $port)) |
355 . (empty($port) ? '' : (':' . $port)) |
352 . $path |
356 . $path |
353 . $query; |
357 . $query |
|
358 . $fragment; |
354 return true; |
359 return true; |
355 } |
360 } |
356 |
361 |
357 /** |
362 /** |
358 * Normalizes OpenID identifier that can be URL or XRI name. |
363 * Normalizes OpenID identifier that can be URL or XRI name. |