Bug #76954 [NEW]: Function apache_response_headers removes last character from header name

From: Date: Mon, 01 Oct 2018 04:53:07 +0000
Subject: Bug #76954 [NEW]: Function apache_response_headers removes last character from header name
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217333@lists.php.net to get a copy of this message
From: sasa dot todorovic101 at gmail dot com Operating system: Linux PHP version: 7.2.10 Package: CGI/CLI related Bug Type: Bug Bug description:Function apache_response_headers removes last character from header name Description: ------------ This function works correctly in PHP 5.x, but in PHP 7.x(sapi CGI) last characters from header's names are removed. More details - https://github.com/Automattic/wp-super-cache/issues/539 Test script: --------------- <?php header( 'Link: <http://www.example.com/wp-json>; rel="https://api.w.org/"' ); header( 'X-Robots-Tag: noindex,nofollow,noarchive' ); echo '<html><body><pre>'; foreach ( apache_response_headers() as $hdr_key => $hdr_val ) { echo $hdr_key . ' => ' . htmlentities( $hdr_val ) . PHP_EOL; } echo '</pre></body></html>'; Expected result: ---------------- X-Powered-By => PHP/7.2.10 Link => <http://www.example.com/wp-json>; rel="https://api.w.org/" X-Robots-Tag => noindex,nofollow,noarchive Content-type => text/html; charset=UTF-8 Actual result: -------------- X-Powered-B => PHP/7.2.10 Lin => <http://www.example.com/wp-json>; rel="https://api.w.org/" X-Robots-Ta => noindex,nofollow,noarchive Content-typ => text/html; charset=UTF-8 -- Edit bug report at https://bugs.php.net/bug.php?id=76954&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76954&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76954&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76954&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76954&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76954&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76954&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76954&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76954&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76954&r=support Expected behavior: https://bugs.php.net/fix.php?id=76954&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76954&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76954&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76954&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76954&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76954&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76954&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76954&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76954&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76954&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76954&r=mysqlcfg

« previous php.bugs (#217333) next »