Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad formatting of message #15

Closed
reedy opened this issue Feb 20, 2017 · 3 comments
Closed

Bad formatting of message #15

reedy opened this issue Feb 20, 2017 · 3 comments
Assignees

Comments

@reedy
Copy link
Contributor

reedy commented Feb 20, 2017

https://github.com/upwork/php-upwork/blob/master/src/Upwork/API/AuthTypes/AbstractOAuth.php#L150-L152

Ends up with the code outputting something along the lines of:

Visit https://www.upwork.com/services/api/auth?oauth_token=a1b2c3d4and provide oauth_verifier for further authorization$ 

None of the new lines are respected, and the and is put at the end of the token. This makes copying the url a harder process, and the whole thing harder to read

@reedy
Copy link
Contributor Author

reedy commented Feb 20, 2017

Seems to be related to readline

php > $authUrl = 'http://foo.bar/';
php > $prompt = 'Visit ' . $authUrl . "\n" . 'and provide oauth_verifier for further authorization' . "\n" .'$ ';
php > echo $prompt;
Visit http://foo.bar/
and provide oauth_verifier for further authorization
$ 
php > readline($prompt);
Visit http://foo.bar/and provide oauth_verifier for further authorization$ 

@reedy
Copy link
Contributor Author

reedy commented Jul 25, 2017

$ dpkg -l | grep readline
ii  libreadline-dev:amd64               7.0-0ubuntu2                             amd64        GNU readline and history libraries, development files
ii  libreadline6:amd64                  6.3-8ubuntu8                             amd64        GNU readline and history libraries, run-time libraries
ii  libreadline7:amd64                  7.0-0ubuntu2                             amd64        GNU readline and history libraries, run-time libraries
ii  php7.0-readline                     7.0.18-0ubuntu0.17.04.1                  amd64        readline module for PHP
ii  readline-common                     7.0-0ubuntu2                             all          GNU readline and history libraries, common files
$ uname -a
Linux ubuntu64-web-esxi 4.10.0-28-generic #32-Ubuntu SMP Fri Jun 30 05:32:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ php --version
PHP 7.0.18-0ubuntu0.17.04.1 (cli) (built: Apr 26 2017 23:59:48) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.18-0ubuntu0.17.04.1, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
$ php -a
Interactive mode enabled

php > $authUrl = 'http://foo.bar/';
php > $prompt = 'Visit ' . $authUrl . "\n" . 'and provide oauth_verifier for further authorization' . "\n" .'$ ';
php > echo $prompt;
Visit http://foo.bar/
and provide oauth_verifier for further authorization
$
php > readline($prompt);
Visit http://foo.bar/and provide oauth_verifier for further authorization$
php >
php >

@mnovozhylov
Copy link
Contributor

mnovozhylov commented Jul 26, 2017

Fixed in fe34f2d , v1.2.4

Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants