|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-11-01 14:57 UTC] m at mhn dot me
[2016-11-02 09:56 UTC] cmb@php.net
-Status: Open
+Status: Analyzed
-Assigned To:
+Assigned To: seander
[2016-11-02 09:56 UTC] cmb@php.net
[2017-10-24 05:13 UTC] kalle@php.net
-Status: Analyzed
+Status: Assigned
[2017-10-24 06:07 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: seander
+Assigned To:
[2018-02-10 00:06 UTC] o dot orcinus at gmail dot com
[2018-02-24 14:17 UTC] cmb@php.net
-Status: Open
+Status: Analyzed
[2018-02-24 14:17 UTC] cmb@php.net
[2018-05-03 09:51 UTC] dennis dot eichardt at addapptr dot com
[2018-06-28 08:56 UTC] remi@php.net
[2018-06-28 08:56 UTC] remi@php.net
-Status: Analyzed
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
Description: ------------ On a completely blank Ubuntu 16.04 server: apt install php7.0 php7.0-dev php-pear pecl install oauth-2.0.2 echo "extension=oauth.so" > /etc/php/7.0/cli/conf.d/20-oauth.ini Paste the following in to a file named test.php: ``` <?php $o = new OAuth("foo", "bar", OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION); try { $o->fetch("http://example.com/", null, OAUTH_HTTP_METHOD_GET); } catch (Exception $e){} $fullInfo = $o->getLastResponseInfo(); foreach(array_keys($fullInfo) as $key) { echo str_pad($key, 30); $split = str_split($key); foreach ($split as $chr) { echo str_pad(ord($chr), 4); } echo PHP_EOL; } $testString = "test"; echo str_pad($testString, 30); $split = str_split($testString); foreach ($split as $chr) { echo str_pad(ord($chr), 4); } echo PHP_EOL; ``` php test.php ``` http_code 104 116 116 112 95 99 111 100 101 0 content_type 99 111 110 116 101 110 116 95 116 121 112 101 0 url 117 114 108 0 header_size 104 101 97 100 101 114 95 115 105 122 101 0 request_size 114 101 113 117 101 115 116 95 115 105 122 101 0 filetime 102 105 108 101 116 105 109 101 0 ssl_verify_result 115 115 108 95 118 101 114 105 102 121 95 114 101 115 117 108 116 0 redirect_count 114 101 100 105 114 101 99 116 95 99 111 117 110 116 0 total_time 116 111 116 97 108 95 116 105 109 101 0 namelookup_time 110 97 109 101 108 111 111 107 117 112 95 116 105 109 101 0 connect_time 99 111 110 110 101 99 116 95 116 105 109 101 0 pretransfer_time 112 114 101 116 114 97 110 115 102 101 114 95 116 105 109 101 0 size_upload 115 105 122 101 95 117 112 108 111 97 100 0 size_download 115 105 122 101 95 100 111 119 110 108 111 97 100 0 speed_download 115 112 101 101 100 95 100 111 119 110 108 111 97 100 0 speed_upload 115 112 101 101 100 95 117 112 108 111 97 100 0 download_content_length 100 111 119 110 108 111 97 100 95 99 111 110 116 101 110 116 95 108 101 110 103 116 104 0 upload_content_length 117 112 108 111 97 100 95 99 111 110 116 101 110 116 95 108 101 110 103 116 104 0 starttransfer_time 115 116 97 114 116 116 114 97 110 115 102 101 114 95 116 105 109 101 0 redirect_time 114 101 100 105 114 101 99 116 95 116 105 109 101 0 headers_recv 104 101 97 100 101 114 115 95 114 101 99 118 0 test 116 101 115 116 ``` Note the 0/NULL character at the end of every row except the manually added "test" row. You can also see that the NULL byte messed with the string padding since it's invisible.