marig345 / oauth-php

Automatically exported from code.google.com/p/oauth-php
MIT License
0 stars 0 forks source link

commit r163 introduce bugs #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in the 163 commit, the following test has been added to fix the issue 71 :

if (strpos($_SERVER['REQUEST_URI'], "://") === false) {
    $uri = $_SERVER['REQUEST_URI'];
}
else {
    $uri = sprintf('%s://%s%s', $proto, $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']);
}

but if strpos($_SERVER['REQUEST_URI'], "://") is false (and even if it's 0, not 
sure than this is really the good test to perform), the builded uri will be 
wrong, just test this part of code with following values :

$proto='http';
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['REQUEST_URI'] = '/foo';

$uri will be /foo

$proto='http';
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['REQUEST_URI'] = 'http://example.com/foo';

$uri will be http://example.comhttp://example.com/foo

if you update the test to : if (strpos($_SERVER['REQUEST_URI'], "://") !== 
false),  in both tests, uri will be http://example.com/foo

Original issue reported on code.google.com by bisounou...@gmail.com on 24 Nov 2010 at 9:32

GoogleCodeExporter commented 9 years ago
You are correct, my bad. :( Thanks, fixed on r169

Original comment by brunobg%...@gtempaccount.com on 24 Nov 2010 at 1:06