php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59642 file_get_contents returns invalid results when wincache reroutes this function
Submitted: 2011-03-01 17:11 UTC Modified: 2014-07-03 21:28 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: bretb at microsoft dot com Assigned: ericsten (profile)
Status: Wont fix Package: WinCache (PECL)
PHP Version: 5.3.5 OS: Windows 2008 R2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
10 + 1 = ?
Subscribe to this entry?

 
 [2011-03-01 17:11 UTC] bretb at microsoft dot com
Description:
------------
WinCache version 1.2.1010.0 

When wincache is enabled to reroute the file_get_contents function, the results returned are null.



[PHP_WINCACHE]
extension=php_wincache.dll
wincache.rerouteini=reroute.ini

Reroute.ini:

[FunctionRerouteList]
file_exists=wincache_file_exists
file_get_contents:2=wincache_file_get_contents
filesize=wincache_filesize
readfile:2=wincache_readfile
is_readable=wincache_is_readable
is_writable=wincache_is_writable
is_writeable=wincache_is_writable
is_file=wincache_is_file
is_dir=wincache_is_dir
realpath=wincache_realpath

Reproduce code:
---------------
<html>
<head></head>
<body>
  <p>Hit Submit to see the posted data.</p>
  <form method="POST">
    <input type="hidden" name="someHiddenValue" value="shh!">
    <input type="submit" value="Submit">
  </form>
  <p>
  Data: 
  <?php
  $sData = file_get_contents("php://input");
  echo $sData;
  ?>
  </p>
</body>
</html>


Expected result:
----------------
Expect the output of the page to be:

Data: someHiddenValue=shh%21

Actual result:
--------------
Data:

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-15 08:28 UTC] robert dot wojciechowski at rmiondemand dot com
I've been working with Bret on this issue. We ran into this 
issue originally on our application and have been working 
around it by disabling the reroute.ini line for 
file_get_contents.
 [2011-07-06 01:07 UTC] nieves dot blasco at ua dot ac dot be
Well done article that. I'll make sure to use it wielsy.
 [2014-02-20 16:32 UTC] ericsten@php.net
-Assigned To: +Assigned To: ericsten
 [2014-07-03 21:28 UTC] ericsten@php.net
-Status: Assigned +Status: Wont fix
 [2014-07-03 21:28 UTC] ericsten@php.net
Reroute functionality has been disabled in Wincache for over three years, and is no longer supported.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:30 2024 UTC